Interview Prep/GitHub Actions/Permissions, Tokens & Secrets

`remote: Permission to devopsshack/shack-api.git denied to github-actions[bot]. fatal: unable to access 'https://github.com/devopsshack/shack-api/': The requested URL returned error: 403`

BeginnerTroubleshootingPermissions, Tokens & Secrets
Answer

Likely causes → Token has contents: read only (restricted default), the branch is protected and the bot is not allowed to push, or persist-credentials: false removed the credentials.

Diagnose → Check "GITHUB_TOKEN Permissions" in the log and branch protection or rulesets on the target branch.

Fix → permissions: contents: write for that job; push to an unprotected branch and open a PR; or use a GitHub App in the ruleset bypass list.

Prevent → Prefer PR-based automation over direct pushes to protected branches.

All GitHub Actions questions Roadmap: GitHub Actions

More on Permissions, Tokens & Secrets