Skip to content

Post coverage comment #6697

Post coverage comment

Post coverage comment #6697

# Post PR coverage comment using the artifact produced by the CI workflow.
# Uses the two-workflow pattern recommended by
# py-cov-action/python-coverage-comment-action so fork PRs do not need
# write permissions on the test workflow.
name: Post coverage comment
on:
workflow_run:
workflows: ["CI"]
types:
- completed
permissions:
contents: read
jobs:
post-coverage-comment:
if: >-
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
actions: read
steps:
- name: Post coverage comment
uses: py-cov-action/python-coverage-comment-action@63f52f4fbbffada6e8dee8ec432de7e01df9ba79 # v3.41
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_PR_RUN_ID: ${{ github.event.workflow_run.id }}