Repository navigation
ci: make PR workflows work for pull requests from forks - #5772
Conversation
- verify: check out the PR head commit from the head repo instead of github.head_ref on the base repo, which fails for fork branches - coverage: skip the SonarCloud scan on fork PRs (no SONAR_TOKEN); still runs on push events and same-repo PRs - build-pr-artifacts: skip image build/push jobs on fork PRs (no OIDC token or registry secrets) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #5772 +/- ##
========================================
Coverage 92.44% 92.44%
========================================
Files 741 741
Lines 41121 41121
Branches 9676 9590 -86
========================================
Hits 38015 38015
- Misses 2845 2923 +78
+ Partials 261 183 -78 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the fork-PR CI compatibility changes.
No open issues 🎉
What changed in this PR
This PR makes repository CI compatible with fork pull requests by fixing checkout references and skipping jobs that require unavailable credentials, while preserving same-repository behavior.
Changes:
- Check out the PR head repository and commit SHA for lint and secret-path verification.
- Skip SonarCloud scans for fork PRs while retaining scans for pushes and same-repository PRs.
- Skip artifact tagging and Docker builds for fork PRs, also preventing dependent ingestion tests from running.
| File | Description |
|---|---|
.github/workflows/verify.yml |
Uses the PR’s source repository and head SHA for both checkouts. |
.github/workflows/dt-test-and-report-code-coverage.yml |
Adds a fork guard to the SonarCloud scan. |
.github/workflows/build-pr-artifacts.yml |
Restricts tagging and image-build jobs to same-repository PRs. |
Review effort: Balanced
## What are the changes introduced in this PR? Adds a `fork-pr-contribution` skill (`.claude/skills/fork-pr-contribution/SKILL.md`) so everyone handles open-source contributions the same way: ``` fork PR ──(squash)──▶ contrib/<pr> ──(PR, full CI, merge commit)──▶ develop ``` 1. **Sanity checks on the contributor PR:** lint, format, secret paths and unit tests run on fork PRs since #5772. Lists which checks are expected to be skipped (Docker build, ingestion test, Sonar) or to fail (org-level zizmor `scan`). 2. **Review the diff before it reaches our repo:** in our repo it runs with our secrets. The skill says to stop and escalate on `.github/`, Dockerfile, npm script, lockfile or test-setup changes, and includes a grep for env, shell and network access. 3. **Squash-merge into `contrib/<pr>`:** the squash commit is authored by the PR author, so the contributor keeps the credit. 4. **Raise `contrib/<pr>` → `develop`:** reuses the contributor's title and description, with a credit header. 5. **Full CI, then merge with a merge commit:** squashing here would make the maintainer the author. ## Please explain the objectives of your changes below Fork PRs can't run the checks that need secrets, and those checks show as *skipped*, which branch protection treats as passing. Without a shared process, a fork PR can be merged into `develop` without the full CI ever running. Agreed in standup; first used on #5771 → #5774. ## Any changes to existing capabilities/behaviour? None. Docs and agent skill only, no runtime or CI changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code)



What are the changes introduced in this PR?
PRs opened from forks fail six CI checks before any of the contributor's code is tested (e.g. #5771). The workflows assume the PR branch lives in this repo and that secrets are available. Neither is true for a fork PR.
verify.yml)actions/checkoutusedref: github.head_refagainst this repo; the fork's branch doesn't exist here, sogit fetchexits 1pull_request.head.shafrompull_request.head.repo.full_namedt-test-and-report-code-coverage.yml)SONAR_TOKEN→ "Not authorized"pushand same-repo PRsbuild-pr-artifacts.yml)Configure AWS Credentialsfails, as fork PRs get no OIDC token or registry secretsFor same-repo PRs, nothing changes.
verify.ymlstill lints the PR head commit; it now refers to it by SHA instead of by branch name.Security: the trigger stays
pull_request(read-only token, no secrets), notpull_request_target, andpersist-credentials: falseis kept.Not covered here: the org-level
zizmorscan check also fails on fork PRs, at its "Mint scanner token" step. It's defined outside this repo, so it needs a separate fix there.How was this change tested?
actionlint(v1.7.7) on the three workflows: no findings on changed lines (one existingset-outputdeprecation atdt-test-and-report-code-coverage.yml:32, untouched)Checklist
🤖 Generated with Claude Code