Skip to content

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

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

ajianaz merged 3 commits into
developfrom
fix/cla-check-fork-safe

Conversation

@ajianaz

@ajianaz ajianaz commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

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 emits a ::error annotation with the portal link
  • github-script upgraded to v9

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. Verified on uteke PR #1221 (fork), run 34481899319: signed='true' yet POST /statuses -> 403; the comment step was also skipped (forks cannot comment at all).

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 unchanged: signed -> green, unsigned -> red with an explanatory annotation. Fix was validated end-to-end on codecoradev/uteke (PR #1224 + E2E probe PR #1225: ruleset swapped to require cla-check, all checks green, merge CLEAN with an empty combined commit status).

Testing

  • Structural asserts: no createCommitStatus, no statuses: write, comment step same-repo-conditioned + continue-on-error, ::error present, check-step body byte-identical to the original, trigger untouched
  • Functional test of the check script against live signatures.json: signed and unsigned paths both correct
  • Same patch validated live on uteke (#1224, merged); this PR applies the identical validated transformation
  • Post-merge: ruleset required context swaps CLA Check -> cla-check (case-sensitive) via API, then the PR is mergeable

Notes

Until the ruleset swap, new PRs show a missing CLA Check context — expected transitional state; this PR itself may show it. Sequence: merge this -> ruleset swap -> mergeable.

The CLA gate relied on a manually POSTed commit status. Fork PRs run
workflows with a read-only GITHUB_TOKEN regardless of declared
permissions, so the status step always 403s on forks — every external
fork PR was permanently red even with a signed CLA. The bot comment
step also 403s on forks.

- Drop the commit-status step and statuses:write; the gate now rides
  on this job's own Actions check run (fork-safe by construction).
- Comment step becomes same-repo-only + continue-on-error (courtesy,
  never a gate). Unsigned path emits a ::error annotation with the
  portal link instead.
- github-script upgraded to v9.

Validated end-to-end on codecoradev/uteke (PR #1224 + E2E probe).
The if-expression was missing the opening quote before the JSON array
inside fromJSON(), which makes the whole workflow unparseable for
GitHub Actions. Line now matches the validated uteke@develop file
verbatim.
@ajianaz
ajianaz merged commit db3ca67 into develop Sep 11, 2026
16 checks passed
@ajianaz
ajianaz deleted the fix/cla-check-fork-safe branch September 11, 2026 06:19
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