Interview Prep/GitHub Actions/Workflows Not Triggering & Invalid Files

A workflow file change in a PR does not take effect; the old behaviour runs.

IntermediateTroubleshootingWorkflows Not Triggering & Invalid Files
Answer

Likely causes → The trigger reads the workflow from the default branch: pull_request_target, workflow_run, issue_comment, schedule. Or you re-ran an old run, which reuses the original workflow file.

Diagnose → Check the trigger; check the run's commit and attempt number (gh run view <id> --json headSha,attempt).

Fix → Merge the change to the default branch for those triggers; push a new commit instead of re-running.

Prevent → Know which events use base vs head workflow definitions.

All GitHub Actions questions Roadmap: GitHub Actions

More on Workflows Not Triggering & Invalid Files