-
Notifications
You must be signed in to change notification settings - Fork 483
43 lines (38 loc) · 1.21 KB
/
Copy pathgas-diff-comment.yml
File metadata and controls
43 lines (38 loc) · 1.21 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
name: Post Gas Diff Comment
on:
workflow_run:
workflows: ["ci"]
types:
- completed
jobs:
comment:
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Download gas diff artifact
uses: actions/download-artifact@v8.0.1
with:
name: gas-diff
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.workflow_run.id }}
- name: Read PR number
id: pr
run: echo "number=$(cat pr-number.txt)" >> "$GITHUB_OUTPUT"
- name: Read gas diff
id: gas_diff
run: |
if [ -f comment.md ] && [ -s comment.md ]; then
{
echo "markdown<<__GASDIFF_EOF__"
cat comment.md
echo "__GASDIFF_EOF__"
} >> "$GITHUB_OUTPUT"
fi
- name: Add gas diff to sticky comment
uses: marocchino/sticky-pull-request-comment@v2
with:
number: ${{ steps.pr.outputs.number }}
delete: ${{ !steps.gas_diff.outputs.markdown }}
message: ${{ steps.gas_diff.outputs.markdown }}