Skip to content

ci: skip the build and deploy when only documentation changed - #51

Merged
jjosef merged 1 commit into
mainfrom
ci/skip-build-for-docs-only
Sep 20, 2026
Merged

jjosef merged 1 commit into
mainfrom
ci/skip-build-for-docs-only

Conversation

@jjosef

@jjosef jjosef commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

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-ignore on 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 small changes job diffs the PR against its base, and the check job only runs when something else changed.

Why the PR workflow skips per job, not with paths-ignore

A skipped job reports success. A workflow that never starts leaves a required status pending forever. The main-merge ruleset does not require CI / check today, but docs/ci-cd.md said it did, and if someone adds it later a workflow-level filter would deadlock every docs-only PR.

Checked

  • Nothing reads these files at build or run time; the only mentions in code are comments and error messages, and docs/ contains only markdown.
  • The classifier regex was run against realistic change sets: docs/rules/README only skips; docs plus one source file, a workflow file, package.json and the lockfile all still build.
  • Both workflow files parse (triggers and the needs/if wiring confirmed).

Docs

docs/ci-cd.md describes the new behavior. It also replaces the claim that main requires CI / check with what the ruleset actually enforces, read from the GitHub API: one approving review, linear history, no force-push or deletion. CI / check is 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.yml itself, so merging it runs one full pipeline. After it lands, docs-only merges (for example #50) deploy nothing.

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.
@jjosef
jjosef merged commit 320743a into main Sep 20, 2026
2 checks passed
@jjosef
jjosef deleted the ci/skip-build-for-docs-only branch September 20, 2026 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant