Repository navigation
fix: skip coverage PR comment for fork pull requests - #51
Merged
Merged
Conversation
GitHub gives pull_request workflows from forks a read-only GITHUB_TOKEN, regardless of the permissions the workflow requests. The comment step then fails with "Resource not accessible by integration", which fails the coverage job even though coverage was generated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Coverage after merging fix/coverage-comment-fork-prs into master will be
Coverage Report for Changed Files
|
garethj2
approved these changes
Nov 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
Code Coveragejob fails on pull requests from forks, as seen on #50:Coverage generates correctly. Only the final
Report coverage on PRstep fails, when it tries to post its comment. GitHub givespull_requestworkflows from forks a read-onlyGITHUB_TOKEN, so the job'spull-requests: writerequest isn't honored.Change
Run the comment step only when the PR branch is in this repository. Fork PRs skip the comment, and the HTML coverage report is still uploaded as an artifact.
pull_request_targetwould provide a write token, but this job builds and runs the PR's code, so a fork could get hold of that token.Testing
🤖 Generated with Claude Code