forked from sudip-mondal-2002/Amplitron
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (37 loc) · 1.05 KB
/
Copy pathcoverage-comment.yml
File metadata and controls
42 lines (37 loc) · 1.05 KB
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
38
39
40
41
42
name: Post Coverage Comment
on:
workflow_run:
workflows: ["CI - Build and Test"]
types:
- completed
permissions:
pull-requests: write
contents: read
jobs:
post-comment:
runs-on: ubuntu-latest
if: github.event.workflow_run.event == 'pull_request'
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: pr-coverage-comment
path: pr_coverage
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
- name: Get PR Number
id: get-pr-number
run: |
if [ -f "pr_coverage/pr_number.txt" ]; then
PR_NUMBER=$(cat pr_coverage/pr_number.txt)
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV
else
echo "No PR number found"
exit 1
fi
- name: Post Comment
uses: marocchino/sticky-pull-request-comment@v2
with:
header: coverage
number: ${{ env.PR_NUMBER }}
path: pr_coverage/coverage_comment.md