A JavaScript toolkit for the GitHub API.
Questions tagged [octokit-js]
82 questions
1
vote
0 answers
Append to a Github Check run
Github APIs allow use to get a check run by id: https://docs.github.com/en/rest/reference/checks#get-a-check-run / https://octokit.github.io/rest.js/v18#checks-get
This can be used to get the output of a check run and then one can append it with new…

basarat
- 261,912
- 58
- 460
- 511
1
vote
0 answers
How do I properly narrow a type in Typescript?
I'm using Octokit which is a GitHub client. I'm trying to read the contents of a directory and the return type of octokit.repos.getContent is a type union that has many possible values.
I'm trying to narrow the return value of getContent to only one…

Adam Arold
- 29,285
- 22
- 112
- 207
1
vote
1 answer
OctoKit NodeJS Get all commits of all repos in user/org
I'm using the NodeJS OctoKit API and for our business analytics I'm trying to gather a list of all commits across all repositories. So I can make a little "ranking".
const owner = req.params.owner;
const { data } = await octokit.request('GET…

RefDev001
- 11
- 1
1
vote
1 answer
ASP .Net Core 3.1 octokit rest npm package issues
I use npm and a gulpfile.js to essentially export npm packages to a 'lib' folder under 'wwwroot'; this works a treat and whenever I update a specific npm package if it's in my gulpfile.js watch list it'll push the contents to the 'lib' folder.
The…

JoeTomks
- 3,243
- 1
- 18
- 42
1
vote
1 answer
Troubleshooting 'Cannot read property , undefined' errors
I have this function
function getAvailableProviders(tmpDir, snips, processRepo) {
const octokit = require("@octokit/rest");
octokit.repos.listForOrg(
{ org: "terraform-providers", type: "public", per_page: 100 },
(error, result) => {
…

Chief
- 130
- 10
1
vote
0 answers
How can I get Pull Request details using the octokit js client?
When trying to get the details for a specific pull request (via a call to ocktokit.pulls.get, I get the error "Resource not accessible by integration". Doing the exact same thing for an issue (octokit.issues.get) works as expected. I'm using the…

Jer
- 5,468
- 8
- 34
- 41
1
vote
1 answer
Unable to Authenticate as Github App with Octokit/rest
I'm unable to authenticate as an app using Octokit/rest and the documentation as failed me...
Here's my routine for authenticating:
async function getGithub({payload}) {
const auth = createAppAuth({
id: parseInt(process.env.APP_ID, 10),
…

hjfitz
- 399
- 4
- 15
1
vote
1 answer
Github API returning Error: Unable to get local issuer certificate
I am trying to hit our enterprise github API endpoint to retrieve the app installation details.
I get the following error while hitting the API from local/postman
Error: Unable to get local issuer certificate.
However, works fine in browser.
I tried…

freakomonk
- 574
- 1
- 5
- 15
1
vote
1 answer
Encoding issue with reading markdown files on Github
When I load a markdown file from GitHub I am running into a lot of errors. I think I am not using the right encoding for GitHub files through Octokit. Any suggestions on how to fix my Buffer code in Node.js?
Is base64 and then to ascii correct for…

Luke Brown
- 1,854
- 2
- 28
- 49
1
vote
1 answer
Token passed to createTokenAuth is not a string : octokit, auth-token
I am trying to build a GitHub App and following the https://probot.github.io/docs/ and https://octokit.github.io/rest.js/v17#authentication. It is basically a nodejs app.
I have no experience working with nodejs or typescript and not even the…

Asif Kamran Malick
- 2,409
- 3
- 25
- 47
1
vote
1 answer
Adding a user as collaborator of an github organization with octokit ends in 404
I want to add GitHub users as collaborators of an organization repository using NodeJS octokit/rest library. The library and manually sent requests to GitHub API repond with HTTP 404 - Not Found, even if my user account has a valid access token with…

spethso
- 29
- 7
0
votes
0 answers
How to find the user name who merged the pr to the base branch from the octokit library
Can anyone tell me that how to fetch the user name who merged the pr by the octokit.request api call.
I can fetch all the prs from octokit.request method with the query parameter state=all value. It is returning the array having all PRs (open and…

Amit Limbasiya
- 1
- 2
0
votes
0 answers
How to access a private github image file with an access_token and render to html
I have an application where a user logs in via oauth, i have access to the user's github access_token.
I want to be able to render a private repository image to html, using the users access_token or something i can obtain via the access_token?
for…

Kay
- 17,906
- 63
- 162
- 270
0
votes
0 answers
Octokit pagination does not play well with Typescript
I have the following reasonably straight-forward code:
export async function getAllRepos({
token,
}: {
token: string;
}): Promise {
const octokit = buildOctokit(token);
const repos = await…

Alper
- 3,424
- 4
- 39
- 45
0
votes
0 answers
Transferring git repository using REST API fails
I'm trying to achieve Github repo transfer (on both private and public repos) via their REST API. For this I have tried the below options
With Github App and Oktokit
const app = new App({
appId: ,
privateKey: ,
});
const…

Muthu Thavamani
- 1,325
- 9
- 19