repository_dispatch response unpredictable

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.

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.

1 Like