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

repository_dispatch response unpredictable

Solved! Go to Solution.

I am facing an interesting problem with `repository_dispatch`,

using it for a repo inside an GitHub org., when I use "my" access token, it's `204 No Content`, i.e a success,

 

but when I use token of any other member(same membership level as mine) in the repo, it's a 404 Not Found.

The scopes are all the same for the generated token.

 

Any idea what could be happening?

curl -i -X POST -H "Authorization: token <TOKEN>"  -H "Accept: application/vnd.github.everest-preview+json"  -H "Content-Type: application/json" --data '{"event_type":"add_user","client_payload":{"key":"value"}}' "https://api.github.com/repos/<ORG_NAME>/<REPO_NAME>/dispatches"

Basically, just changing the `TOKEN` in the above snippet changes the behavior, even though the membership level and scopes are the same for another member in the org.

1 Reply
Highlighted
Solution
GitHub Partner
Message 2 of 2

Re: repository_dispatch response unpredictable

Hi @geekodour ,

 

I can repro on my side. This is due to organization team member is lack of 'write' permisson to the repository.

It's 'Read' only by default, which means can not use 'POST' in rest api command. Please change it to 'write',  it works on my side.

Memberpermisson.png