Comment on PR #554
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Comment on PR | |
# following example: https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ | |
on: | |
workflow_run: | |
workflows: ["Unit tests"] | |
types: | |
- completed | |
jobs: | |
report-coverage: | |
if: > | |
github.event.workflow_run.event == 'pull_request' && | |
github.event.workflow_run.conclusion == 'success' | |
runs-on: [self-hosted, linux, x64, gpu] | |
container: | |
image: ubuntu | |
permissions: | |
# Read the action that triggered this one | |
actions: read | |
# Allow to write check runs | |
checks: write | |
# Allow for editing existing comments | |
contents: write | |
# Allow publishing new comments on PRs | |
pull-requests: write | |
# Read and update commit statuses | |
statuses: write | |
# Allow to check commit statusses | |
steps: | |
- name: Download Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: coverage | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
run-id: ${{ github.event.workflow_run.id}} | |
- name: get PR | |
id: get-pr | |
run: echo "PR=$(cat coverage.PR)" >> "$GITHUB_OUTPUT" | |
- name: Get Coverage | |
uses: 5monkeys/cobertura-action@master | |
with: | |
path: coverage.xml | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
pull_request_number: ${{ steps.get-pr.outputs.PR }} | |
minimum_coverage: 88 | |
show_missing: True | |
fail_below_threshold: True | |
link_missing_lines: True | |
# False for now, might set to true later | |
only_changed_files: False |