ci: skip the build and deploy when only documentation changed - #51
Merged
Merged
Conversation
A docs-only merge ran the full pipeline: build, deploy to dev, e2e, prod-diff, and then a prod approval waiting on a human. None of it can be affected by a markdown file. deploy.yml: `paths-ignore` on the push trigger (`*.md`, `*.mdc`, `docs/`, `.cursor/`, `.claude/`, CODEOWNERS, LICENSE). GitHub skips the workflow only when EVERY changed file matches, so a mixed change still deploys. Verified nothing reads these files at build or run time (the only mentions in code are comments and error messages). ci.yml: a small `changes` job diffs the PR against its base and the `check` job runs only when something else changed. This is a job-level skip rather than `paths-ignore` on purpose: a skipped job reports success, whereas a workflow that never starts leaves any required `CI / check` status pending forever. The `main-merge` ruleset does not require that check today, but the docs said it did, and adding it later would otherwise deadlock every docs-only PR. The classifier was exercised on realistic change sets: docs, rules and README only skip; docs plus one source file, a workflow file, package.json, the lockfile, and a Markdown file inside an app (still ignored) all behave as intended. Both workflow files parse. docs/ci-cd.md describes the new behavior, and replaces the claim that `main` requires `CI / check` with what the ruleset actually enforces (one approving review, linear history, no force-push or deletion), read from the GitHub API. Note: this change edits deploy.yml itself, so merging it runs one full pipeline.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A docs-only merge currently runs the whole pipeline: build, dev deploy, e2e, prod-diff, then a prod approval waiting on a human. None of that can be affected by a markdown file.
Change
deploy.yml:paths-ignoreon the push trigger for*.md,*.mdc,docs/,.cursor/,.claude/,.github/CODEOWNERS,LICENSE. GitHub skips the workflow only when every changed file matches, so a mixed change still deploys.ci.yml: a smallchangesjob diffs the PR against its base, and thecheckjob only runs when something else changed.Why the PR workflow skips per job, not with
paths-ignoreA skipped job reports success. A workflow that never starts leaves a required status pending forever. The
main-mergeruleset does not requireCI / checktoday, butdocs/ci-cd.mdsaid it did, and if someone adds it later a workflow-level filter would deadlock every docs-only PR.Checked
docs/contains only markdown.package.jsonand the lockfile all still build.needs/ifwiring confirmed).Docs
docs/ci-cd.mddescribes the new behavior. It also replaces the claim thatmainrequiresCI / checkwith what the ruleset actually enforces, read from the GitHub API: one approving review, linear history, no force-push or deletion.CI / checkis not a required status today. The doc had described it as a load-bearing security control, so you may want to add it (safe now).Heads up
This edits
deploy.ymlitself, so merging it runs one full pipeline. After it lands, docs-only merges (for example #50) deploy nothing.