A JavaScript toolkit for the GitHub API.
Questions tagged [octokit-js]
82 questions
0
votes
0 answers
Github - Different search results from the web vs the API
I am using the Octokit.js library and I get different results from the search method vs when I use the web UI at https://github.com/search. The query I am running is:
state:open is:pr review-requested:myusername
The web UI returns all the PRs where…

user3690467
- 3,049
- 6
- 27
- 54
0
votes
0 answers
GitHub Enterprise - How to create internal repositories
I´m working for a bigger company and we have the enterprise version available.
We´ve created an organization and now I want to create Repositories with the octokit API client.
Directly with Postman it works like that (it works perfectly)
Request…

Wurzelseppi
- 95
- 1
- 10
0
votes
0 answers
Tauri - Download latest release from private GitHub repo
As my title suggests, I would like to download an asset from the latest release in a private github repo. I'm using Octokit/core to get the latest release assets, but I have some issues getting the file to download.
Using tauri-plugin-upload it…

DogFoxX
- 111
- 10
0
votes
0 answers
How to get a list of commits affecting files in a certain directory on Github on deleted branch in Node GitHub Action
I have a mono repo and I want to figure out "per package" diff in Github actions.
I'm using git rev-list --format=%aN%cN%B ..HEAD -- packages/, which is working fine and giving all commits to analyse.
However, some of commits are…

Matthew
- 33
- 7
0
votes
0 answers
GITHUB API: create repository on user's github account
I am developing a web application were I require to create a repository on user's github account using github app and oauth access token
but I am getting 403 error when making a post request
error: Resources not accessible by…
0
votes
1 answer
Getting sha of file on GitHub not working
When I try to get the sha of a certain file on GitHub the undefined value is returned. I was using the same method several days ago and everything was ok. How to get sha?
let text = '';
import {Octokit} from "https://cdn.skypack.dev/octokit";
import…

trzczy
- 1,325
- 2
- 18
- 43
0
votes
0 answers
Octokit version of exchanging code for token?
I'm looking for Octokit package and code that is equivalent of exchanging the auth2 app code for a token.
There are so many npm packages for octokit, I'm not even sure which one to look for.
export async function getToken(code:string) {
const…

DFBerry
- 1,818
- 1
- 19
- 37
0
votes
1 answer
Octokit.js github base url setup
I am trying to authenticate with my enterprise github through App in octokit.js but I couldn't find any parameter to change gihub url. Can someone please help?
const {Octokit, App} = require('octokit')
// below points to github.com
const app = new…

Jags
- 799
- 7
- 19
0
votes
1 answer
Github-Actions: link pull request to issue
I'm quite a rookie with GitHub Actions so this might be a stupid question: Is there a way to link pull requests with issues (in the UI linked PRs are shown under Development) in Github Actions using Github CLI or octokit/rest.js via…

Sly78
- 1
- 1
0
votes
0 answers
Octokit Express Middleware with Next.js
I am just practicing creating a GitHub app. Part of the Octokit it says that I can use the createNodeMiddleware. Now that might not necessarily be as simple with next.js; however, the problem that I am having is actually a compiler error (it seems)…

Sean W.
- 863
- 5
- 14
0
votes
1 answer
How to mock octokit.rest.repos.getContent()
How can I mock octokit library in jest
import { Octokit } from '@octokit/rest';
The code I'm using is:
const { data: entity } = await octokit.rest.repos.getContent({owner, repo, path, ref})

Akash
- 75
- 1
- 8
0
votes
0 answers
Finding a user's first commit to an organization using octokit
I'm currently trying to script something up in Node using Octokit that will allow me to measure the first commit of a user within a GitHub organisation.
It's fairly trivial to get a list of all the users within that organisation, but where I'm…

f1dave
- 1,267
- 4
- 20
- 31
0
votes
1 answer
Octokit-js based app throws JSON web token error
I'm having issues with an octokit-based nodejs app that was working just a couple of weeks ago. From nowhere, I'm getting auth errors that I've managed to debug to the point of getting this error message:
A JSON web token could not be decoded
This…

Juan P Reyes
- 77
- 9
0
votes
0 answers
How to get local git directory information using Octokit.js?
Is it possible to open local git folder with Octokit.js and get git information for it?
Thank you!

Alex
- 63
- 1
- 9
0
votes
1 answer
How to import octokit in browser
tried to follow an example from this. To import octokit I first pasted the following lines into my html document as stated by adding the following lines: