-
Notifications
You must be signed in to change notification settings - Fork 456
56 lines (49 loc) · 2.09 KB
/
post-ci.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
on:
workflow_run:
workflows:
- Continuous Integration
types:
- completed
name: Post CI
# This is adapted from https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_run (2022-07-17)
jobs:
on-failure:
runs-on: ubuntu-latest
steps:
- name: Fetch PR Data
uses: dawidd6/action-download-artifact@246dbf436b23d7c49e21a7ab8204ca9ecd1fe615
with:
name: pr_number
workflow: ci.yml
run_id: ${{ github.event.workflow_run.id }}
- name: Save PR Data
id: save-pr-data
run: |
echo "pr_number=$(cat pr_number)" >> $GITHUB_OUTPUT
echo "pr_sha=$(cat pr_sha)" >> $GITHUB_OUTPUT
echo "merge_sha=$(cat merge_sha)" >> $GITHUB_OUTPUT
- name: Add Comment
uses: marocchino/sticky-pull-request-comment@39c5b5dc7717447d0cba270cd115037d32d28443
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
with:
number: ${{ steps.save-pr-data.outputs.pr_number }}
recreate: true
message: |
The commit ${{ steps.save-pr-data.outputs.pr_sha }} (as a parent of ${{ steps.save-pr-data.outputs.merge_sha }}) contains errors.
Please inspect the [Run Summary](https://github.com/ethereum/ercs/${{ steps.save-pr-data.outputs.pr_number }}/files) for details.
- name: Add Waiting Label
uses: actions-ecosystem/action-add-labels@288072f1a3b596f4350fe135bcfe381a23abadef
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
with:
labels: w-ci
number: ${{ steps.save-pr-data.outputs.pr_number }}
repo: ${{ github.repository }}
github_token: ${{ github.token }}
- name: Remove Waiting Label
uses: actions-ecosystem/action-remove-labels@d05162525702062b6bdef750ed8594fc024b3ed7
if: ${{ github.event.workflow_run.conclusion != 'failure' }}
with:
labels: w-ci
number: ${{ steps.save-pr-data.outputs.pr_number }}
repo: ${{ github.repository }}
github_token: ${{ github.token }}