Skip to content

fix(ci): stop failing external PRs on missing coverage token - #1765

Merged
dkhawk merged 2 commits into
mainfrom
fix/coverage-comment-fork-prs
Aug 26, 2026
Merged

fix(ci): stop failing external PRs on missing coverage token#1765
dkhawk merged 2 commits into
mainfrom
fix/coverage-comment-fork-prs

Conversation

@kikoso

@kikoso kikoso commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

The Report tests results workflow (report.yml) fails on every pull request from a fork, even when the build and tests pass. Root cause: the final Jacoco Report to PR step needs secrets.SYNCED_GITHUB_TOKEN_REPO to comment on the PR, and GitHub never exposes repo secrets to a pull_request triggered run from a fork. The step errors with 'token' is missing and the whole job is reported as failed.

Seen on #1758.

Fix

Add continue-on-error: true to the Jacoco Report to PR step, so that step's failure no longer fails the job or the check. The build and test steps above it are unchanged and remain the real signal for whether the PR is good.

Note this does not make the coverage comment itself appear on fork PRs, since secrets are still never available to a pull_request run triggered by a fork. I initially tried a workflow_run based split to get the comment posted for fork PRs too, but that trips this repo's mandatory zizmor security scan, which blocks any use of the workflow_run trigger outright regardless of how it is used (confirmed against zizmor's own docs, no accepted mitigation exists for that trigger). Given that constraint, this settles for external PRs going green without a coverage comment, rather than overriding the security gate.

Test plan

report.yml previously tried to comment on the PR with a secret token
in the same job that pull_request triggers for fork PRs, which
GitHub always runs without secrets. That made the coverage step fail
outright on every external contribution even when the build and
tests passed.

Split the work: report.yml now only builds and uploads the jacoco
XML reports plus PR metadata as an artifact, no secrets needed.
A new report-comment.yml, triggered by workflow_run, downloads that
artifact and posts the comment. workflow_run jobs always run in the
base repo's context with full secrets, regardless of what triggered
the run they react to, so this works the same way for fork and
internal PRs.
@kikoso
kikoso requested a review from a team as a code owner August 26, 2026 16:25
The earlier workflow_run split to post coverage comments for fork PRs
tripped the repo's mandatory zizmor security scan, which blocks any
use of the workflow_run trigger regardless of how it is used.

Revert to a single job. Fork PRs still cannot get a coverage comment,
since secrets.SYNCED_GITHUB_TOKEN_REPO is never available to a
pull_request run triggered by a fork, but continue-on-error on that
step stops it from failing the whole check. The build and test steps
above it remain the real pass/fail signal.
@kikoso kikoso changed the title fix(ci): post coverage comments for fork PRs via workflow_run fix(ci): stop failing external PRs on missing coverage token Aug 26, 2026
@googlemaps-bot

googlemaps-bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Code Coverage

Overall Project 44.77% 🍏

There is no coverage information present for the Files changed

@dkhawk
dkhawk merged commit 09030dc into main Aug 26, 2026
13 checks passed
@dkhawk
dkhawk deleted the fix/coverage-comment-fork-prs branch August 26, 2026 17:48
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.

3 participants