Skip to content

ci: skip heavy CI work on docs-only pull requests - #26

Merged
ahsanalidotme merged 3 commits into
mainfrom
ci/skip-docs-only
Oct 27, 2026
Merged

ahsanalidotme merged 3 commits into
mainfrom
ci/skip-docs-only

Conversation

@ahsanalidotme

Copy link
Copy Markdown
Contributor

Closes: no issue (requested directly).

What

Stop spending Actions minutes on docs-only pull requests: CI skips its heavy steps when a PR only touches docs, while the required checks still report success.

How

  • New changes job in each PR-triggered workflow. It diffs the PR against its base (git diff --name-only --no-renames origin/<base>...HEAD) and pipes it through scripts/docs-only-changes.sh, which outputs docs_only=true only when every path matches **/*.md, docs/**, LICENSE*, .github/ISSUE_TEMPLATE/**, .github/pull_request_template.md.
  • ci.yml: Lint · Typecheck · Build · Codegen and Example · JS + Android build keep running and report, every step gated. ios.yml: Build example (iOS simulator) (not required, macOS) is skipped at job level.
  • No paths-ignore: required checks must still report. Each gated job has needs: changes and if: ${{ !cancelled() }}, and every heavy step has if: needs.changes.outputs.docs_only != 'true', plus a first step that logs docs-only change — skipped.
  • Fails safe: only a pull_request run can skip; these always run in full: push to main. A git error, an empty diff or a failing changes job leaves the output empty, so everything runs.
  • Look like docs but count as code: none.

Production impact

Breaking change (API, SDK or behaviour) No
Database migration No
Index added or changed No
New env var, secret or config No
Safe to roll back Yes
Risk Low

CI-only. No runtime code changes; nothing ships to users.

Tests

Tests added or updated for all new and changed code N/A (CI config; checked by hand, see below)
Unit tests pass locally N/A
CI green see checks
  • actionlint on every changed workflow: no new findings.

  • Docs script checked against README / nested .md / docs/ / LICENSE* / PR template / code / empty input.

  • This PR changes workflows and scripts, so its own CI runs in full.

Preview

None (CI only).

Details (optional)

How to verify the skip after merge:

  • The next docs-only PR (for example a README edit) should show the required checks green within seconds, each with a docs-only change — skipped notice, and the changes job log listing the files.

Links

  • Reference implementation: linktrail-io/linktrail-ios-sdk-source#45 (e2e.yml changes job, scripts/docs-only-changes.sh).

Add a changes job that marks a pull request docs-only when every changed path is docs (**/*.md, docs/**, LICENSE*, .github/ISSUE_TEMPLATE/**, .github/pull_request_template.md). Required jobs still run and report, with their heavy steps gated on it; push, schedule and dispatch runs, and any error, run in full.
@ahsanalidotme

Copy link
Copy Markdown
Contributor Author

Impact: no database changes. No live/runtime code changes: CI workflows and helper scripts only. Production impact: none.

@ahsanalidotme
ahsanalidotme marked this pull request as ready for review October 27, 2026 21:51
No GitHub-hosted minutes: the new docs-only changes job runs on
[self-hosted, macOS] like the rest of the org's CI.
The runner plan changed: public repos stay on GitHub-hosted runners
(free for public repos), so the changes job goes back to ubuntu-latest
and needs no fork guard.
@ahsanalidotme
ahsanalidotme merged commit 08bc0ea into main Oct 27, 2026
9 checks passed
@ahsanalidotme
ahsanalidotme deleted the ci/skip-docs-only branch October 27, 2026 23:40
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