FEAT: Forked PR coverage comment workflow#375
Conversation
There was a problem hiding this comment.
Pull request overview
This PR implements a workflow_run solution to enable posting code coverage comments on pull requests from forked repositories, which normally face token permission restrictions. The implementation splits the coverage reporting into two workflows: one that runs on pull_request events and collects coverage data, and another that runs on workflow_run completion events with elevated permissions to post comments.
Key Changes:
- Added artifact-based data passing between the coverage workflow and a new comment-posting workflow
- Created a new workflow triggered by workflow_run events to handle comment posting with proper permissions
- Added test print statements to main.py to validate the PR workflow
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| .github/workflows/pr-code-coverage.yml | Added steps to save coverage data as JSON artifact and conditionally skip PR comments for forked repos |
| .github/workflows/post-coverage-comment.yml | New workflow that downloads coverage artifacts from completed workflow runs and posts PR comments with proper permissions |
| main.py | Added test print statements to validate the workflow (test changes only) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9011198 to
7e50a98
Compare
bewithgaurav
left a comment
There was a problem hiding this comment.
I have added comments related to logic optimizations, restructuring and code comments. requesting changes on this, please reach out if you need any clarification 👍
4b724e0 to
d126932
Compare
b78baf5 to
50023f7
Compare
919e6f7 to
ad54413
Compare
2d45b4d to
2f4efea
Compare
bewithgaurav
left a comment
There was a problem hiding this comment.
the forked checks will be done as soon as thi gets merged to main, please test this on forked PRs by pulling latest main - approving the changes
Work Item / Issue Reference
Summary
Testing the workflow_run solution for posting coverage comments on forked PRs.