-
Notifications
You must be signed in to change notification settings - Fork 96
fix(ci): Handle fork PRs gracefully in coverage comment step #8694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Detect fork PRs and skip comment posting (no write permissions) - Add try-catch to handle 403 permission errors gracefully - Log informative messages directing users to workflow summary - Prevents workflow failure when PR is from a fork 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
🤖 AI PR Validation ReportPR Review ResultsThank you for your submission! Here's detailed feedback on your PR title and body compliance:✅ PR Title
✅ Commit Type
✅ Risk Level
✅ What & Why
✅ Impact of Change
✅ Test Plan
✅ Contributors
✅ Screenshots/Videos
Summary Table
Final Message: Actionable suggestions (small, optional) to make review and verification faster:
Thanks — this is a well-written PR description that gives reviewers enough context to approve the CI-only fix. Please update with the run link if available and proceed.Last updated: Fri, 09 Jan 2026 16:34:20 GMT |
|
📊 Coverage check completed. See workflow run for details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a permission error in the PR coverage workflow that occurs when PRs are opened from forks. Fork PRs lack write permissions to the base repository, causing the workflow to fail with a 403 error when attempting to post coverage comments.
Key Changes:
- Add fork detection logic using GitHub's context API to identify fork PRs early
- Wrap comment posting in try-catch to handle permission errors gracefully
- Provide informative log messages directing users to workflow summary for coverage results
Commit Type
Risk Level
What & Why
The PR coverage workflow fails when attempting to post a comment on PRs from forks. This is because fork PRs don't have write permissions to the base repository.
Error observed:
Fix:
context.payload.pull_request?.head?.repo?.forkThe coverage check itself still runs and reports results in the GitHub Actions step summary - only the PR comment is skipped for forks.
Impact of Change
Test Plan
Manual Testing Evidence
Why automated tests are not feasible:
This is a GitHub Actions workflow that can only be tested by running in CI. The fork detection logic uses GitHub's context payload which is only available during workflow execution.
Verification approach:
Related issue:
Contributors
@krrishmittal
Screenshots/Videos
N/A - CI workflow changes only