-
Notifications
You must be signed in to change notification settings - Fork 33
FEAT: Forked PR coverage comment workflow #375
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
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 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
There was a prob 8000 lem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
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.
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.