-
Notifications
You must be signed in to change notification settings - Fork 1
70 lines (65 loc) · 1.97 KB
/
CommentBreakage.yml
File metadata and controls
70 lines (65 loc) · 1.97 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Comment Breakage
on:
workflow_call:
jobs:
comment_pr:
runs-on: ubuntu-latest
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success'
steps:
- name: Download PR number artifact
uses: dawidd6/action-download-artifact@v17
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: Breakage
run_id: ${{ github.event.workflow_run.id }}
name: pr-number
path: pr-number
use_unzip: true
- name: Read PR number
id: read_pr
run: |
PR_NUMBER=$(cat pr-number/pr-number.txt)
echo "PR_NUMBER=$PR_NUMBER" >> "$GITHUB_ENV"
echo "pr_number=$PR_NUMBER" >> "$GITHUB_OUTPUT"
- name: Download breakage artifacts
uses: dawidd6/action-download-artifact@v17
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: Breakage
run_id: ${{ github.event.workflow_run.id }}
name: breakage-*
name_is_regexp: true
path: breakage
merge_multiple: true
use_unzip: true
- run: ls -R
- name: Generate summary
run: |
cd breakage
echo "| Package name | latest | stable |" > summary.md
echo "|--|--|--|" >> summary.md
count=0
for file in breakage-*
do
if [ $count == "0" ]; then
name=$(echo $file | cut -f2 -d-)
echo -n "| $name | "
else
echo -n "| "
fi
cat $file
if [ $count == "0" ]; then
echo -n " "
count=1
else
echo " |"
count=0
fi
done >> summary.md
- name: PR comment with file
uses: thollander/actions-comment-pull-request@v2
with:
filePath: breakage/summary.md
pr_number: ${{ steps.read_pr.outputs.pr_number }}