Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 2
Message 1 of 2

Can't create repo hook, with correct OAuth scopes

I am trying to create a repo webhook. The code I have successfully works when authenticating as the repo owner via a token, but not with a collaborator. The scopes are correct, as far as I know.

 

All other operations to the repo seem to work fine with this token (creating/updating issues and more).

 

I am using the octokit wrapper: octokit.repos.createHook, but have also tested a raw request and get the same result.

 

The response I get is:

HttpError: Not Found
status: 404

 

I am fairly sure that the token scopes are correct, as in the 404'd response I receive, the headers are as such:

'x-accepted-oauth-scopes': 'admin:repo_hook, repo, write:repo_hook',
'x-oauth-scopes': 'admin:org_hook, admin:repo_hook, read:org, repo',

 

Am I missing something obvious here?

 

Request log, for completeness:

{ 
  method: 'POST',
  url: 'https://api.github.com/repos/jpsear/gh-projects-test/hooks',
  headers: { 
    accept: 'application/vnd.github.v3+json',
    'user-agent': 'octokit.js/16.34.0 Node.js/8.17.0 (macOS Catalina; x64)',
    authorization: 'token [REDACTED]',
    'content-type': 'application/json; charset=utf-8' 
  },
  body: '{"name":"web","config":{"url":"[REDACTED-BY-JPSEAR]","content_type":"json"},"events":["project","project_card","project_column","meta","issues","issue_comment","label","repository","member","milestone"],"active":true}',
  request: { hook: [Function: bound bound register], validate: [Object] } },
  documentation_url: 'https://developer.github.com/v3/repos/hooks/#create-a-hook' 
}

 

1 Reply
Highlighted
Copilot Lvl 2
Message 2 of 2

Re: Can't create repo hook, with correct OAuth scopes

Can anyone verify if this is a legitimate bug, or something that I am doing incorrectly?