You must run a workflow only if the commit message does not contain `[skip ci]`.
BeginnerScenarioGitHub Actions
Answer
Situation read → Skip behaviour.
What I'd do →
- GitHub natively skips
push/pull_requestruns when the head commit message has[skip ci],[ci skip],[no ci],[skip actions]or[actions skip]. - For finer control add
if: "!contains(github.event.head_commit.message, '[skip release]')".
Why → The native keywords skip workflows without extra code.
Interview tip → Skipped required checks can block merges; use sparingly on protected branches.
More on GitHub Actions
What are workflows, jobs, steps and actions in GitHub Actions?BeginnerWhat events can trigger a workflow?BeginnerWhat is the difference between `pull_request` and `pull_request_target`?AdvancedWhat is a runner, and how do GitHub-hosted and self-hosted runners differ?BeginnerHow do you pass data between steps and between jobs?IntermediateHow does a build matrix work?Intermediate