Push rejected: `remote: - GITHUB PUSH PROTECTION` and `Push cannot contain secrets` pointing at a commit from three commits ago.
IntermediateTroubleshootingGitHub, Actions and Pull Request Issues
Answer
Likely causes → Secret scanning push protection found a credential pattern (AWS key, GitHub token, Slack webhook) in one of the commits you are pushing — not necessarily the latest one. Removing it in a new commit does not help; it is still in history.
Diagnose → The output lists the secret type, commit SHA and path. Confirm with git show <sha> -- <path>.
Fix → Remove it from the commit itself, then push:
git rebase -i <sha>^ # mark the commit as "edit"
# remove the secret from the file, use an env var instead
git add config/app.yml && git commit --amend --no-edit
git rebase --continue
git push
If the secret was real, rotate it. Only use the "allow secret" link for verified false positives or test credentials.
Prevent → Run gitleaks or trufflehog in pre-commit, and load secrets from a vault or environment.
More on GitHub, Actions and Pull Request Issues
A workflow step that pushes a version bump fails with `remote: Permission to org/repo.git denied to github-actions[bot].` and `The requested URL returned error: 403`.IntermediateA workflow pushes a commit or tag, but the workflow that should run on that push or tag never starts.IntermediateA container job fails on any Git command with `fatal: detected dubious ownership in repository at '/__w/app/app'`.IntermediateYour PR suddenly shows 340 changed files and dozens of commits you did not write.IntermediateThe PR is stuck on `Expected — Waiting for status to be reported` for a required check called `build`.IntermediateThe PR was approved, but merging shows "Review required" again after you pushed a small fix.Beginner