0

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,
});
Roberto Rossini
  • 158
  • 2
  • 10
  • "If I use the personal access token linked to the non-owner account, I get a 404 HTTP error code" Doesn't this depend on the particular permissions granted by the PAT? – matt Jan 09 '23 at 00:38
  • Also have you considered the `gh` tool? I find it a lot easier than the API. – matt Jan 09 '23 at 00:40
  • Hey @matt, thank you for your reply! The permissions granted by the PAT are the same in the 2 cases. The only difference is that when an account does not own the repo, the PAT is not created specifically for that repo (I guess that is the real issue but I do not know how to overcome it). Also, I had a check to the `gh` tool, but I do not believe that can help me for my use case – Roberto Rossini Jan 10 '23 at 10:38
  • I wonder whether this is germane: https://docs.github.com/en/repositories/creating-and-managing-repositories/creating-an-issues-only-repository – matt Jan 12 '23 at 10:29
  • Hey @matt thanks again for your reply! I think this repo of issues could be useful, but it does not really solve the issue of creating an issue for a repo you do not own – Roberto Rossini Jan 16 '23 at 13:30

0 Answers0