Skip to content

Commit 7201f0b

Browse files
committed
Add CI workflow for posting code coverage results on pull request completion
1 parent fdb25b0 commit 7201f0b

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: CI Post Comment
2+
on:
3+
workflow_run:
4+
workflows: ["CI"]
5+
types:
6+
- completed
7+
jobs:
8+
post-comment:
9+
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request' }}
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Download code-coverage-results
13+
uses: actions/download-artifact@v4
14+
with:
15+
name: analysis-results
16+
run-id: ${{ github.event.workflow_run.id }}
17+
github-token: ${{ secrets.GITHUB_TOKEN }}
18+
19+
- name: Add Coverage PR Comment
20+
uses: marocchino/sticky-pull-request-comment@v2
21+
if: github.event_name == 'pull_request'
22+
with:
23+
recreate: true
24+
path: code-coverage-results.md
25+
number: ${{ github.event.workflow_run.pull_requests[0].number }}

0 commit comments

Comments
 (0)