GitHub Actions "Permission to X denied to github-actions[bot]"
A git push using the GITHUB_TOKEN was denied because the bot identity lacks write access. This is a permissions issue; a retry changes nothing.
What this error means
A push step fails with "remote: Permission to <owner>/<repo>.git denied to github-actions[bot]".
github-actions
remote: Permission to octo/repo.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/octo/repo/': The requested URL returned error: 403Common causes
contents permission not granted
Pushing commits needs contents: write, which the default token may not have.
Protected branch blocks the bot
Branch protection can forbid the bot from pushing even with contents write.
How to fix it
Grant contents write or use a PAT
- Add permissions: contents: write to the job.
- For protected branches, push via a PAT allowed to bypass protection.
.github/workflows/ci.yml
permissions:
contents: writeHow to prevent it
- Decide up front whether CI should push, and grant the minimum scope.
- Exempt a dedicated automation identity from branch protection if pushes are required.
Frequently asked questions
What causes ""Permission to X denied to github-actions[bot]""?
Pushing commits needs contents: write, which the default token may not have.
How do I fix "Permission to X denied to github-actions[bot]"?
Grant contents write or use a PAT
Related guides
GitHub Actions 403 while pushing with GITHUB_TOKENFix the GitHub Actions 403 error when pushing with the GITHUB_TOKEN, caused by a missing contents write scope…
GitHub Actions checkout persisted credentials push 403Fix the GitHub Actions 403 when pushing after actions/checkout, caused by the persisted GITHUB_TOKEN lacking…
GitHub Actions default GITHUB_TOKEN permissions cause a 403Fix the GitHub Actions 403 caused by the repository or org default GITHUB_TOKEN being read-only, so write API…