Run CI on fork pull requests - #185
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
WalkthroughThe lint workflow now grants only ChangesLint workflow access and fork execution
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
averyjennings
left a comment
There was a problem hiding this comment.
Approve — no blockers.
This removes the three job-level if: fork guards from .github/workflows/lint.yml, restoring ShellCheck/Completions/BATS coverage for fork PRs. Verified it's a clean, intentional revert of #179's lint.yml change (the PR blob matches the exact pre-#179 version; #179's commit 828413f added precisely these three lines), not a stale-snapshot regression.
The security reasoning in the description holds up under inspection:
- The workflow triggers on plain
pull_request, notpull_request_target— so fork runs get no repository secrets and a read-onlyGITHUB_TOKEN.permissions: read-allenforces read-only regardless. lint.ymlreferences no secrets at all. The only secret-bearing workflow,homebrew.yml(HOMEBREW_TAP_TOKEN), triggers solely onreleaseandworkflow_dispatch— neither reachable from a fork PR.- The three jobs only checkout, install tooling, and run linters/tests on an ephemeral runner. Residual risk is runner compute abuse, already covered by GitHub's contributor-approval gate (and the stricter "Require approval for all outside collaborators" setting noted in the description if you want it).
This is a strict improvement: previously the skipped jobs reported neutral/green, so fork PRs like #183 merged with zero real CI coverage. Now those checks actually run.
Summary
contents: read.Why
The existing job guards skip all CI for external contributions, so fork pull requests can appear green without running ShellCheck or tests. Plain
pull_requestworkflows are GitHub's intended unprivileged path for validating fork code.Security model
pull_requestruns receive no repository secrets.GITHUB_TOKENis limited tocontents: read, the minimum recommended for checkout.persist-credentials: falsekeeps that token out of Git configuration used by subsequent scripts.Validation
mainis conflict-free.Summary by CodeRabbit