int128 / update-generated-files-action

Push commit to pull request for auto-fix in GitHub Actions
Apache License 2.0
4 stars 5 forks source link

Permission denied to github-actions[bot] #411

Open Achllle opened 1 year ago

Achllle commented 1 year ago

I'm getting a permission denied error (log here) even though settings > actions > general > permissions for both the fork and the target repo are set to 'read and write'.

/usr/bin/git -c http.https://github.com/.extraheader= -c http.https://github.com/.extraheader=AUTHORIZATION: basic *** push origin HEAD:refs/heads/add_2beam
remote: Permission to nasa-jpl/open-source-rover.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/nasa-jpl/open-source-rover/': The requested URL returned error: 403
Error: Error: The process '/usr/bin/git' failed with exit code 128

If instead I push directly to the target branch, the worflow runs and asks to create a PR, which when merged makes the follow-up workflow complete successfully.

Any help on what might be going on is appreciated. Worflow file here.

Achllle commented 9 months ago

@int128 any ideas? EDIT: I thought it might have to do with the fact that we're using forks and so I pushed the same branch to the target repository to see if that would make it succeed but it failed as well.

int128 commented 9 months ago

I could reproduce this problem in the following context:

Since GITHUB_TOKEN of the upstream repository does not have a permission to write the head branch, it fails. I think it is possible to fallback to create a follow-up pull request in this case.