Repository navigation
feat(skip-ci): Add an action that skips CI for pushes changing only matching files - #187
bitsandfoxes wants to merge 8 commits into
Conversation
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4c355f5. Configure here.
jpnurmi
left a comment
There was a problem hiding this comment.
Q: Could Re-run all jobs skip the skip? Might be nice to be able to run the full CI that way.
The action could read |

A push to a pull request that only touches Markdown, such as a CHANGELOG fix-up, still runs the full CI. A workflow's
paths-ignorecan't help: GitHub matches it against the whole pull request, so once a pull request changes code, every later push runs everything (actions/runner#2324).skip-ciis a composite action that tells whether a push can skip the expensive jobs. A repo adds one small job that runs it and gates its build and test jobs on the action'sskipoutput:sentry-unity does the same in its own workflow (getsentry/sentry-unity#2942). This action makes it available to every repo, with the file patterns configurable.
Does my push run CI?
Say you fix a typo in the CHANGELOG of your pull request. CI runs again unless it was green on your previous push and the new push changes only files that match
paths.flowchart TD push([You push a commit]) --> pr{To an open pull request?} pr -- no --> run([CI runs]) pr -- yes --> green{CI green on the previous push?} green -- no --> run green -- yes --> files{Only files matching paths changed?} files -- no --> run files -- yes --> skip([Gated jobs skip]) classDef accent fill:#2da44e,stroke:#1a7f37,color:#ffffff class skip accentThe details, all of which must hold for
skipto betrue. Anything else, including an API error, givesfalse, and CI runs:pull_requestwith thesynchronizeaction.push,workflow_dispatch,merge_groupandpull_request_targetalways givefalse.false.paths. For a renamed file, its old name must match too.pathstakes one pattern per line and defaults to**/*.md.**crosses folders,*and?don't, and a leading!takes files back out. The last pattern that matches a file decides.The action never fails the job. When it skips, it writes the reason to the job summary.
The action's README covers the caveats:
ghandpwshon the runner.