How to create a GitHub issue using the APIs in a private repo

154 Views Asked by At

My goal is to be able to create issues from a Node.js backend application. Everything worked fine when I used a "Fine-grained personal access token" linked to the owner account of the repo. However, I would like to have another account that through the API can create an issue.

If I use the personal access token linked to the non-owner account, I get a 404 HTTP error code.

I also tried creating an organization and setting both accounts as owners of the organization, but I still get a 404. I am probably missing out something.

I set up the API request following the official documentation.

My backend code is:

await octokit.request(`POST /repos/${repoUser}/${repo}/issues`, {
  owner: repoUser,
  repo: repo,
  title: title,
  body: issueBody,
});
0

There are 0 best solutions below