Skip to content

Comment on error

Comment on error #582

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 :)"
})