-
-
Notifications
You must be signed in to change notification settings - Fork 136
36 lines (34 loc) · 1.22 KB
/
comment-on-error.yaml
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
name: Comment on error
on:
workflow_run:
workflows: ["filter-files"]
types:
- completed
jobs:
upload:
runs-on: ubuntu-latest
if: >
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'failure'
steps:
- name: Download build artifact from triggered workflow
uses: dawidd6/action-download-artifact@v2
with:
run_id: ${{ github.event.workflow_run.id }}
# name: website_out
# path: site_out
search_artifacts: true
- name: Get ISSUE_NUMBER
run: echo "ISSUE_NUMBER=$(cat website_out/pr_number.txt)" >> $GITHUB_ENV
- name: Get filterout
run: echo "MSG=$(cat website_out/filterout.txt)" >> $GITHUB_ENV
- uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: ${{ env.ISSUE_NUMBER }},
owner: context.repo.owner,
repo: context.repo.repo,
body: "⚠️ **We have detected a problem with your submission!** ⚠️\n\n${{ env.MSG }}\n\nPlease make the aforementioned changes and re-submit :)"
})