Skip to content

fix(ci): make cla-check work for fork PRs - #1224

Merged
ajianaz merged 1 commit into
developfrom
fix/cla-check-fork-safe
Sep 11, 2026
Merged

ajianaz merged 1 commit into
developfrom
fix/cla-check-fork-safe

Conversation

@ajianaz

@ajianaz ajianaz commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

What

  • cla-check.yml no longer POSTs a commit status (context CLA Check); the CLA gate now rides on the job's own Actions check run (cla-check)
  • Removes the statuses: write permission
  • PR comment step becomes same-repo-only + continue-on-error (best effort)
  • Unsigned path now emits a ::error annotation with the portal link and auto-refresh info

Why

Fork PRs always run workflows with a read-only GITHUB_TOKEN, regardless of declared permissions. The old design gated CLA on a manually POSTed commit status, so every external fork PR failed the status step with 403 — permanently red even with a signed CLA. Empirical evidence from today: PR #1221 (fork by @KazamiHazaki), run 34481899319: signed='true' yet POST /repos/codecoradev/uteke/statuses/... -> 403 Resource not accessible by integration; the comment step was skipped with zero bot comments on the PR (REST-verified).

The native Actions check run is created by GitHub itself and is not subject to the fork token restriction, making it the correct carrier for the gate. Semantics are unchanged: signed → green, unsigned → red with an explanatory annotation.

Testing

  • Structural asserts on the new YAML (no createCommitStatus, no statuses: write, comment step conditioned + continue-on-error, gate step untouched semantics)
  • Functional test of the check script against live signatures.json from .github@main: KazamiHazaki → signed=true, unknown user → signed=false
  • Full local validation: cargo check, cargo clippy, workspace tests, cargo fmt --check (pre-commit gates, all green; cora review passed)
  • Post-merge (owner): ruleset develop-protected required context swaps CLA Check → cla-check (case-sensitive) via API, then an E2E synthetic PR validates the new gate

Notes for reviewers

Until the ruleset swap lands, new PRs will show a red/pending CLA Check missing context — expected transitional state; this PR itself may show it. Sequence: merge this → ruleset swap → E2E validation.

The CLA gate relied on a manually POSTed commit status (context
'CLA Check'). Fork PRs always run workflows with a read-only
GITHUB_TOKEN regardless of declared permissions, so the status step
always failed with 403 on forks — every external fork PR was
permanently red even with a signed CLA (verified: PR #1221, run
34481899319, POST /statuses -> 403 while signed='true'). The bot
comment step also 403s on forks (skipped in the same run).

- Drop the commit-status step and the statuses:write permission;
  the gate now rides on this job's own Actions check run (created
  by GitHub itself, immune to the fork token restriction).
- Keep the signed->green / unsigned->red semantics via the existing
  'Fail if not signed' step, now with a ::error annotation pointing
  to the signing portal and the auto-refresh behavior.
- Keep the PR comment as a same-repo-only courtesy step
  (continue-on-error) — it can never affect the gate outcome.

Note: the ruleset's required context must switch from 'CLA Check'
to 'cla-check' (case-sensitive) in the same window as this lands;
owner action via API.
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-code · BYOK · MIT

@ajianaz
ajianaz merged commit 3fe6a6b into develop Sep 11, 2026
15 checks passed
@ajianaz
ajianaz deleted the fix/cla-check-fork-safe branch September 11, 2026 03:24
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