Interview Prep/CI/CD/GitHub Actions Failures

`Error: Bad credentials` from `gh` or an action using `GITHUB_TOKEN`.

BeginnerTroubleshootingGitHub Actions Failures
Answer

Likely causes → Token not passed as GH_TOKEN; expired PAT; used inside a container without env.

Diagnose → gh auth status in the step.

Fix → env: GH_TOKEN: ${{ github.token }} on the step.

Prevent → Prefer github.token and set env at job level.

All CI/CD questions

More on GitHub Actions Failures