Repository navigation
ci: run a lighter CI on forks to avoid Actions pauses - #5
Merged
Merged
Conversation
GitHub paused every workflow on a busy fork for Actions usage scale, and a paused fork reports no checks, so its pull requests could merge with no CI. Key job-level `if:` conditions on github.repository so kunchenguid/firstmate still runs every job on every event, while a fork skips the Herdr and macOS stock Bash lanes on pull requests (18 hosted jobs to 16) and runs only the fast tier on main pushes (18 to 3), since the pull request already tested that tree. Lint, repo invariants, the coverage guard and every portable behaviour shard still gate fork pull requests, and the serial shard count is unchanged so no job moves toward its 30-minute bound. tests/fm-ci-workflow.test.sh resolves each job's `if:` for both repositories and events, and docs/fm-test-portable-shards.md "Fork-light CI" owns the rationale.
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.
Intent
Reduce the CI load on the fork prekabreki/firstmate so GitHub does not pause its Actions again.
GitHub paused every workflow on the fork after 2026-10-08 "due to the scale of GitHub Actions usage"; the only sign was a banner on the Actions page, and with zero checks reported, PRs could merge with no CI at all.
The captain re-enabled Actions, and the upstream-sync PR #4 (merged 2026-10-12) then ran all 20 checks green.
Each run fans out to about 20 hosted jobs (lint x2, portable parallel x2, portable serial x9, a Herdr job with a 75-minute backstop, macOS stock bash, coverage, invariants, timing aggregate), plus the separate windows-herdr-spike workflow, and several 2026-10-08 runs were cancelled at the 30-minute timeout.
Constraints set for this work: keep the fork-local divergence in .github/workflows/ minimal; upstream kunchenguid/firstmate must still run exactly what it runs today; prefer a mechanism keyed on the repository (github.repository or a repo variable) over editing matrices or deleting jobs; choose the cuts from evidence; lint, repo invariants and the portable behaviour tests must still run on every PR to main; do not reduce shards if that pushes any job toward its 30-minute timeout; no-mistakes-required.yml stays unchanged; keep tests/fm-ci-workflow.test.sh and docs/fm-test-portable-shards.md (which owns the timeout policy) consistent and document the fork-only behaviour there; the PR targets the fork's main (prekabreki/firstmate), never upstream; the PR body says what the fork now skips or shrinks and roughly how many hosted jobs a PR run drops from and to.
Decisions made: job-level
if:conditions keyed ongithub.repository == 'kunchenguid/firstmate'(self-contained, no repo-variable setup). In a fork, pull requests skip only the Herdr and macOS stock Bash lanes (18 hosted jobs to 16), and pushes to main run only the fast tier - coverage guard, invariants, timing aggregate - (18 to 3), because the PR already tested that tree; the timing aggregate tolerates all its needs being skipped. This is a deliberate trade-off: a commit pushed directly to the fork's main gets only the fast checks, so fork changes needing the full gate go through a PR. Serial shards stay at 9 because fork evidence showed serial shards at 13-20 minutes with one cancelled at 30. windows-herdr-spike.yml is workflow_dispatch-only, never ran on the fork, and is left unchanged. A pre-existing locale defect in bin/fm-test-run.sh --check-coverage (comm without LC_ALL=C) is filed separately and intentionally out of scope.What Changed
.github/workflows/ci.ymlnow gates jobs with job-levelif:conditions ongithub.repository == 'kunchenguid/firstmate', so upstream still runs every job on every event. In a fork, pull requests skip only the Herdr and stock macOS Bash lanes (18 hosted jobs drop to 16). Lint, the coverage guard, invariants, both portable parallel shards, all nine serial shards and the timing aggregate still run. Fork pushes tomainrun only the fast tier (coverage guard, invariants, timing aggregate), so 18 jobs drop to 3. The serial shard count is unchanged, andwindows-herdr-spike.ymlandno-mistakes-required.ymlare untouched.tests/fm-ci-workflow.test.shgains a Ruby-based resolver that evaluates each job'sif:(andneedsfor jobs with noif:) against a simulated repository and event. New tests assert three things: upstream runs every job on both pull requests and pushes, a fork PR runs everything except Herdr and macOS, and a forkmainpush runs exactly the fast-tier jobs.docs/fm-test-portable-shards.mdadds a "Fork-light CI" section with the rationale, what a fork skips, the job counts, and the trade-off: a commit pushed straight to a fork'smaingets only the fast checks.CONTRIBUTING.mdpoints to that section.🤖 Generated with Claude Code
Risk Assessment
✅ Low: The change adds six job-level
if:gates. Each one resolves true for kunchenguid/firstmate on both events, so upstream is unchanged. On a fork, PRs drop from 18 hosted jobs to 16 and main pushes drop to 3, which matches the stated decisions; the timing aggregate's always() and nullglob handling tolerate skipped needs, and the doc and test updates stay consistent with the workflow.Testing
I ran the targeted workflow test, which resolves each job's
if:from the parsed YAML for upstream and the fork on both pull_request and push, and it passed. Four deliberate gating mutations each made it fail, then ci.yml was restored byte-identical and the worktree is clean. I inspected the resolved job set: 18 jobs upstream on both events, 16 on fork PRs, 3 on fork main pushes, serial shards still 9, and the timing aggregate exits 0 with a warning when there are no lane artifacts. Running this live means GitHub Actions on prekabreki/firstmate. That requires a push, which belongs to the outer executor's CI phase, so every scenario is reported untested and the verdict is no-surface. There is no UI, so no visual evidence applies.Evidence: fm-ci-workflow.test.sh transcript
Source: fm-ci-workflow.test.sh transcript
Evidence: Gating mutation checks (each caught, exit 1)
Source: Gating mutation checks (each caught, exit 1)
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
bash tests/fm-ci-workflow.test.sh(12/12 ok, including the 3 new fork/upstream gating assertions)Mutation: removedif:from tests-herdr → fork-PR assertion fails (exit 1); ci.yml restored byte-identical from cp backupMutation: lint gated upstream-only → fork-PR assertion fails (exit 1)Mutation: tests-portable-parallel-1 gated on pull_request only → upstream-push assertion fails (exit 1)Mutation: invariants gated upstream-only → fork assertion fails (exit 1)ruby -ryamldump of every job's if/needs/timeout to confirm job counts 18 → 16 (fork PR) and 18 → 3 (fork push), serial matrix still 9 shards, timing aggregateif: always()with an empty-input warn pathgit diff --stat d1d29783 a1c30b34confirms only ci.yml, the test, and the doc changed (no-mistakes-required.yml and windows-herdr-spike.yml untouched)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.