Closed Goooler closed 2 months ago
According to Permissions for the GITHUB_TOKEN, it's able to send PRs on CI, the issue might be related to the wrong usage of it, fixing the usage will also resolve this issue.
Error: Failure while executing; `/usr/bin/env git push --set-upstream ***github.com/Goooler/homebrew-repo bump-kotlin-explorer-1.6.0:bump-kotlin-explorer-1.6.0` exited with 1. Here's the output:
To https://github.com/Goooler/homebrew-repo
! [rejected] bump-kotlin-explorer-1.6.0 -> bump-kotlin-explorer-1.6.0 (non-fast-forward)
error: failed to push some refs to 'https://github.com/Goooler/homebrew-repo'
https://github.com/Goooler/homebrew-repo/actions/runs/10700380504/job/29663997922
Delete your bump-kotlin-explorer-1.6.0
branch and try again.
Error: Unable to open pull request: GitHub API Error: Resource not accessible by integration
HOMEBREW_GITHUB_API_TOKEN may be invalid or expired; check:
https://github.com/settings/tokens
https://github.com/Goooler/homebrew-repo/actions/runs/10700629318/job/29664778250
Your GITHUB_TOKEN
needs write access to pull requests.
Please use the discussions page if you need more help.
I replaced the custom GitHub access token with
${{ secrets.GITHUB_TOKEN }}
when usingHomebrew/actions/bump-packages
, which should be able to send PRs on GHA, but with an error:It failed to create PR here, I believe we can replace this step with
gh pr create ...
for creating PRs on GitHub Actions, which uses GitHub official's GH CLI to do the same thing, without explicit PAT declared.