-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
37 lines (34 loc) · 1.25 KB
/
coverage_comment.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: 'coverage_comment'
# This workflow runs after the 'Verify packages abilities' workflow is completed for a pull request.
# The workflow downloads the coverage report if the 'Verify packages abilities' workflow was successful.
# The workflow then adds a comment to the PR with the coverage report.
on:
workflow_run:
workflows: ['Verify packages abilities']
types:
- completed
jobs:
download_coverage:
runs-on: ubuntu-latest
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
steps:
- name: Download artifact
id: download-artifact
uses: dawidd6/action-download-artifact@v6
with:
workflow: tests.yml
workflow_conclusion: success
run_id: ${{ github.event.workflow_run.id }}
name: code-coverage-results
- name: Determine PR number
id: pr-number
run: |
PR_NUMBER=$(cat pr_number.txt)
echo "Found PR:$PR_NUMBER"
echo "value=$PR_NUMBER" >> $GITHUB_OUTPUT
- name: Add PR comment
uses: marocchino/sticky-pull-request-comment@v2
with:
number: ${{ steps.pr-number.outputs.value }}
recreate: true
path: code-coverage-results.md