Skip to content

ci: skip heavy test/lint/build/gen jobs for docs-only pull requests - #7486

Open
harshalsp07 wants to merge 1 commit into
pipe-cd:masterfrom
harshalsp07:fix/7007-skip-ci-docs-only
Open

harshalsp07 wants to merge 1 commit into
pipe-cd:masterfrom
harshalsp07:fix/7007-skip-ci-docs-only

Conversation

@harshalsp07

@harshalsp07 harshalsp07 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Skip heavy CI jobs for pull requests that change only documentation (docs/** or **/*.md).

A reusable workflow detects non-documentation changes for the test, lint, build, and generation workflows. Required Go test and lint gates stay green when those jobs are intentionally skipped, and fail if change detection or module discovery fails. Push and tag builds still run the jobs.

Fixes #7007.

Testing:

  • actionlint (only finding: the pre-existing ubuntu-26.04 runner label).
  • Verified on a docs-only PR in my fork: Go, web, integration, Helm, and chart jobs skipped; required Go test and lint gates passed. The generation workflow only runs on master, so it was not exercised in the demo.

Copilot AI balanced review requested due to automatic review settings October 14, 2026 17:41
@harshalsp07
harshalsp07 requested a review from a team as a code owner October 14, 2026 17:41
@netlify

netlify Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for pipecd-site canceled.

Name Link
🔨 Latest commit efdaa48
🔍 Latest deploy log https://app.netlify.com/projects/pipecd-site/deploys/6ae0ec3f0fca5761311ed157

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Path-filter failures can incorrectly allow the required Go test and lint gates to succeed without running their workloads.

2 open findings
What changed in this PR

Adds docs-only PR detection to reduce unnecessary CI work while preserving required status checks.

Changes:

  • Adds SHA-pinned path filtering across four CI workflows.
  • Skips heavy build, test, lint, and generation jobs for documentation-only PRs.
  • Updates lint completion gates to tolerate intentionally skipped jobs.
File Description
.github/​workflows/​test.yaml Conditionally skips Go, web, and integration tests.
.github/​workflows/​lint.yaml Conditionally skips linting and vulnerability checks; updates gates.
.github/​workflows/​gen.yaml Skips code generation validation for docs-only PRs.
.github/​workflows/​build.yaml Conditionally skips Go, plugin, web, and chart builds.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/lint.yaml
Comment thread .github/workflows/test.yaml
@armistcxy

Copy link
Copy Markdown
Contributor

@harshalsp07, please keep the PR description concise. I suggest stating the intent clearly first, then summarizing the changes

@armistcxy

Copy link
Copy Markdown
Contributor

A small trick: you can make a temporary PR including documentation changes (in various places), so that we can verify the new workflow actually skips jobs related to code changes

@harshalsp07

Copy link
Copy Markdown
Contributor Author

Trimmed the description — intent first, then the changes. I'll also open a docs-only PR on top of this branch to verify the heavy jobs actually skip.

@armistcxy armistcxy left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont't think adding a same job for all workflows like that is a good idea

@harshalsp07

harshalsp07 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author

yeah i got your point now if i think, duplicating the same job in four workflows it would be hard to maintain .
paths-ignore would be simpler but it leaves the required go-test/go-lint completed checks stuck at "Expected" so docs-only PRs can't merge , that's why the detection is inside the workflows. I can move it into one reusable workflow (workflow_call) that all four call. should i do this or is there some other approach that we can follow ?

@harshalsp07

harshalsp07 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor Author

Moved the detection into one reusable workflow, changes.yaml, that all four call via uses: (710a39d).

For the skip check, #7489 is a docs-only PR on top of this branch. The Go workflows still need a maintainer approval to run for first-time contributors, so approving one there will show the heavy jobs skipping while the two gates stay green.

@harshalsp07

Copy link
Copy Markdown
Contributor Author

Tried the stacked setup in my fork so we don't need a temp branch in this repo — demo PR: harshalsp07#1, run: https://github.com/harshalsp07/pipecd/pull/1/checks

Diff there was only the docs change and it did exactly what it should: go, web, integration, helm, chart all skipped while go-test-completed and go-lint-completed stayed green. (gen didn't run in the demo since it only triggers on master, it gets exercised on the first real docs PR after this merges.)

@harshalsp07
harshalsp07 force-pushed the fix/7007-skip-ci-docs-only branch from 5a37223 to 617a173 Compare October 27, 2026 18:23
@harshalsp07

Copy link
Copy Markdown
Contributor Author

@armistcxy, I consolidated the branch to one commit and updated the PR description. The change-detection failure path now fails the required gates, and the docs-only behavior is verified on my fork. Could you take another look when you have a chance?

@harshalsp07
harshalsp07 force-pushed the fix/7007-skip-ci-docs-only branch from 617a173 to efdaa48 Compare October 27, 2026 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Skip heavy CI jobs (Go test/lint/build, web, integration) for docs-only changes

4 participants