Skip to content

CI: skip heavy jobs for docs-only changes#11263

Closed
sebslight wants to merge 2 commits intomainfrom
ci/skip-heavy-on-docs-only
Closed

CI: skip heavy jobs for docs-only changes#11263
sebslight wants to merge 2 commits intomainfrom
ci/skip-heavy-on-docs-only

Conversation

@sebslight
Copy link
Member

@sebslight sebslight commented Feb 7, 2026

Summary

  • add shared action .github/actions/detect-docs-only
  • add docs-change-scope gate job in targeted workflows
  • docs-only changes now run style checks only (lint, format)
  • non-doc changes keep full CI matrix
  • fail-safe: if diff detection is uncertain, run full workflow

Files

  • .github/actions/detect-docs-only/action.yml
  • .github/workflows/ci.yml
  • .github/workflows/install-smoke.yml
  • .github/workflows/workflow-sanity.yml
  • .github/workflows/formal-conformance.yml

Why

  • cut CI spend/time on docs-only PRs
  • keep fast signal on docs PRs via style gates
  • avoid risky false skips

Validation

  • YAML parse check on touched workflow/action files

@openclaw-barnacle openclaw-barnacle bot added the maintainer Maintainer-authored PR label Feb 7, 2026
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

2 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +10 to +12
- name: Detect docs-only changes
id: scope
uses: actions/github-script@v7
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing permissions for API

This composite action calls GitHub REST APIs via actions/github-script@v7, but the action itself doesn’t declare (or document) required permissions. If a workflow doesn’t grant pull-requests: read (for pulls.listFiles) or appropriate contents access (for repos.compareCommits on push), the script will throw and you’ll fall back to docs_only=false, causing “docs-only” PRs to run the full heavy workflow unexpectedly. Consider explicitly setting job/workflow permissions for the docs-change-scope job (or documenting them in the action) so the gate behaves deterministically.

Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/actions/detect-docs-only/action.yml
Line: 10:12

Comment:
**Missing permissions for API**

This composite action calls GitHub REST APIs via `actions/github-script@v7`, but the action itself doesn’t declare (or document) required permissions. If a workflow doesn’t grant `pull-requests: read` (for `pulls.listFiles`) or appropriate `contents` access (for `repos.compareCommits` on `push`), the script will throw and you’ll fall back to `docs_only=false`, causing “docs-only” PRs to run the full heavy workflow unexpectedly. Consider explicitly setting job/workflow permissions for the `docs-change-scope` job (or documenting them in the action) so the gate behaves deterministically.


How can I resolve this? If you propose a fix, please make it concise.

Comment on lines +13 to +23
docs-change-scope:
runs-on: ubuntu-latest
outputs:
docs_only: ${{ steps.scope.outputs.docs_only }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Detect docs-only changes
id: scope
uses: ./.github/actions/detect-docs-only
Copy link
Contributor

Choose a reason for hiding this comment

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

Gate job may fail

docs-change-scope runs actions/github-script (via the composite action) without setting permissions:. If the repository/org default workflow permissions are set to “read repository contents only”, pulls.listFiles requires pull-requests: read and will fail; that makes the gate always output docs_only=false and defeats the purpose (docs-only PRs still run everything). Add explicit permissions on this job (e.g., permissions: { contents: read, pull-requests: read }) so the condition is reliable.

Prompt To Fix With AI
This is a comment left during a code review.
Path: .github/workflows/ci.yml
Line: 13:23

Comment:
**Gate job may fail**

`docs-change-scope` runs `actions/github-script` (via the composite action) without setting `permissions:`. If the repository/org default workflow permissions are set to “read repository contents only”, `pulls.listFiles` requires `pull-requests: read` and will fail; that makes the gate always output `docs_only=false` and defeats the purpose (docs-only PRs still run everything). Add explicit permissions on this job (e.g., `permissions: { contents: read, pull-requests: read }`) so the condition is reliable.


How can I resolve this? If you propose a fix, please make it concise.

@quotentiroler
Copy link
Contributor

Thanks for tackling this — the goal of skipping heavy CI on docs-only PRs is 100% right. But this approach is over-engineered for what we need:

  1. 70-line composite action + API callspaths-ignore at the trigger level does the same thing for free, with zero API calls and zero extra job boots
  2. checks-docs-style is a 77-line copy-paste of the checks job just to run lint+format — unnecessary duplication
  3. 4 extra docs-change-scope gate jobs across 4 workflows — each one boots a runner just to call the GitHub API
  4. Only checks docs/ — misses standalone .md files like README.md, CONTRIBUTING.md, CHANGELOG.md
  5. Over-scoped skippingworkflow-sanity (no-tabs) and formal-conformance are cheap and should still run on docs PRs

The simpler approach: add paths-ignore: ['docs/**', '**/*.md'] only on the heavy jobs (test matrix, build, android, iOS, macOS) and leave format/lint/cheap checks running on all paths. That's ~3 lines per workflow file, zero custom actions, zero duplication.

Going to close this in favor of the simpler approach.

@sebslight
Copy link
Member Author

@quotentiroler please go ahead.

@sebslight sebslight deleted the ci/skip-heavy-on-docs-only branch February 7, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments