A JavaScript toolkit for the GitHub API.
Questions tagged [octokit-js]
82 questions
6
votes
2 answers
GitHub API v4 Graphql: Get current authorized user organizations and their repositories
In GitHub API v3 with repo and user authorization scopes, I can get my organizations with GET /user/orgs (https://developer.github.com/v3/orgs/#list-organizations-for-the-authenticated-user, with Octokit REST JS,…

Henrique Bruno
- 574
- 1
- 7
- 14
6
votes
1 answer
How do you authenticate a GitHub App in Node.js?
I've created a new GitHub App and I'm trying to authenticate from Node. I'm new to GitHub Apps, for example, I don't know what "installationId" is supposed to be. Is that the App ID?
I successfully get a token using a private key, but when I try…

beachCode
- 3,202
- 8
- 36
- 69
6
votes
0 answers
Hide Github Action when completed on Pull Request
I have a GitHub action that evaluates something and then creates a Status Check with the result.
setup is the one that evaluates and linting is the result (a different status check with all the information). This is done because the default status…

Javier Bullrich
- 389
- 1
- 5
- 22
5
votes
3 answers
List all unresolved pull request comments
We are using the @octokit/rest client to fetch all of the comments on a pull request:
client.pulls
.listComments({
owner,
repo,
pull_number: 34,
per_page: 100,
})
.then((result) => {
console.log(result.data.length);
…

Shaun Luttin
- 133,272
- 81
- 405
- 467
4
votes
0 answers
How to authenticate Octokit using Github Oauth access_token
I'm building a GitHub Oauth app, and I'm trying to authenticate Octokit using an Oauth access_token that I'm getting when the user clicks sign in with Github.
The access_token I'm using has access to the repo scope, but when I try to authenticate…

Ganning Xu
- 263
- 4
- 13
4
votes
0 answers
Octokit rest.js throws a httpError: Not Found
Im trying to update an existing gist using Octokit. I can successfully get the gist but I cannot update the gist. It always throws an httpError: Not Found.
Heres my code:
const request = require('request-promise');
const Octokit =…

Suvin Nimnaka Sukka
- 341
- 1
- 7
- 21
4
votes
1 answer
Use Octokit or the GitHub Rest API to upload multiple files
I'm trying to write a method which takes files from a path and uploads them to a GitHub repo. The files have to remain intact and separate (can't zip them). This is what I've got so far:
addFiles(branch) {
const filePath = this.filePath
…

Alex Foxleigh
- 1,784
- 2
- 21
- 47
3
votes
1 answer
Where can I view the secondary rate limit of GitHub REST api?
I'm trying to create something with GitHub's REST api using Octokit, but I'm having trouble dealing with their secondary rate limit, I wonder where can I view this secondary rate limit, or know exactly how they work? The documentation seems to be…

himynameisjm
- 33
- 3
3
votes
0 answers
Resolving a GitHub Issue from a Project Card via the RESTful SDK
I'm using octokit (https://octokit.github.io/rest.js/v18#projects-list-cards) to interact with my Project and Issues in my repo. I have the project_cards in a list, but I'd like to make some changes to the labels on the issue when I move from column…

aronchick
- 6,786
- 9
- 48
- 75
2
votes
0 answers
Generating response data type of rest api call when using Octokit with typescript classes
I am having difficulty in finding a good way to generate types for Octokit rest API calls. It seems like my requirements might be a bit out of the norm.
Here's what I am trying to do. I am creating a custom action in typescript and I have a class as…

Sayak Mukhopadhyay
- 1,332
- 2
- 19
- 34
2
votes
1 answer
Octokit.js not working with Vite. Module externalized and cannot be accessed in client mode
What am I doing?
I am using Vite for my React app. I'm importing Octokit and binding it like this:
import { Octokit } from "octokit";
const githubToken = import.meta.env.REACT_APP_GITHUB_TOKEN;
const octokit = new Octokit({auth: githubToken});
I…

Roast Biter
- 651
- 1
- 6
- 22
2
votes
0 answers
How to query GitHub deployments using GraphQL and use createdAt as a property?
I would like to query my organization deployments using GraphQL and use createdAt as a property (I am doing the same thing with a pull request query : createdAt:"2022-01-01..2022-01-31").
For now, the only way I've found would be to iterate over my…

acoudouy
- 160
- 1
- 4
2
votes
1 answer
GitHub Octokit: How to make a pull request review comment as resolved?
I’m looking for a way to mark a review comment as ‘RESOLVED’ via the GitHub rest API via Octokit. I’m having a hard time finding documentation on this.
So far I only found how to update a review comment for a pull request on here but not to mark…

Sydney C.
- 950
- 10
- 21
2
votes
1 answer
Using Octokit to fetch pull request within a date range
I'm using Octokit/rest js to fetch pull requests from a repository.
Ideally, I'd like to have pull requests from x date to y date depending on the creation date.
Is there a way to do this?
Right now I'm fetching all the pull requests and then…

Sydney C.
- 950
- 10
- 21
2
votes
3 answers
Programatic github workflow_dispatch does not run the workflow
I am trying to programatically run a github workflow using the workflow_dispatch event.
There are two workflows on the master branch. Release Matrix and Release Single.
The single workflow looks like this and it working…

Andreas Linden
- 12,489
- 7
- 51
- 67