FEAT: Forked PR coverage comment workflow by gargsaumya · Pull Request #375 · microsoft/mssql-python

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.