GitHub Actions workflow not triggered on push
Push to main does not trigger any workflow run
Focused incident mode — strips away everything but this runbook.
Symptoms
- Push to main does not trigger any workflow run
- GitHub Actions tab shows no new run after push
- Workflow only triggers on some branches but not others
Evidence to grab
Collect these artifacts before you change anything — they prove (or rule out) each cause.
Workflow trigger configuration
cat .github/workflows/<file>.yml | grep -A20 'on:'Recent push events
gh api repos/<OWNER/REPO>/events --jq '.[] | select(.type=="PushEvent") | {id: .id, created_at: .created_at}'
Diagnostic flow
Run the steps in order, marking each claim confirmed or refuted. The evidence you gather feeds the ranked causes below.
Guided decision tree is ready.
Steps with commands, expected output, and pass/fail branches.
Ranked root causes
Evidence checklist
- on: push: branches: [develop] but push was to main
- branches-ignore: [main] is present in the trigger
Confirm before fixing
cat .github/workflows/<file>.yml | grep -A10 'on:' | grep -A5 branchesRead branch allow/block list
Fix
sed -i 's/branches:\n\s*- develop/branches:\n - main\n - develop/' .github/workflows/<file>.ymlAdd the missing branch to the trigger
Resolution runbook
Apply from top to bottom after the cause is confirmed. Review every command before running it — risk tags are shown on each.
cat .github/workflows/<file>.yml | head -30Read the on: trigger block
gh api repos/<OWNER/REPO>/events --jq '.[] | select(.type=="PushEvent") | {ref: .payload.ref, created: .created_at}'Check recent push events
git log --oneline -5Confirm what was actually pushed
Prevention
- Use on: push: branches: [main, develop] with an explicit allow-list rather than negation patterns.
- Add a paths-ignore: ['docs/**', '*.md'] to skip doc-only changes intentionally.
- Test trigger logic with 'workflow_dispatch' before relying on push events.
- Keep a CI/README that documents each workflow's trigger conditions.
Related runbooks
Same stack, same failure family — worth a skim.
Workflow run fails immediately with 'Invalid workflow file'
Manually triggered workflow fails because input is empty
Commands marked READ CHANGE DESTRUCTIVE — never run DESTRUCTIVE commands against production data you cannot restore. Copy → verify → execute.