Skip to content

Notify Workflow Failure #130

Notify Workflow Failure

Notify Workflow Failure #130

Workflow file for this run

name: "Notify Workflow Failure"
on:
workflow_run:
workflows: ["Automaton", "Beepsky"]
types: [completed]
jobs:
on-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' && github.event.workflow_run.head_repository.full_name == 'goonstation/goonstation' }}
steps:
- run: |
JSON_FMT='{
"name":"%s",
"url":"%s",
"branch": "%s",
"author": "%s",
"message": "%s",
"commit": "%s",
"api_key": "%s",
"repo": "%s"
}'
curl -X POST -H "Content-Type: application/json" \
-d "$(printf "$JSON_FMT" \
"${{ github.event.workflow_run.name }}" \
"${{ github.event.workflow_run.html_url }}" \
"${{ github.event.workflow_run.head_branch }}" \
"${{ github.event.workflow_run.head_commit.author.name }}" \
"${{ github.event.workflow_run.head_commit.message }}" \
"${{ github.event.workflow_run.head_commit.id }}" \
"${{ secrets.MEDASS_API_KEY }}" \
"${{ github.event.workflow_run.head_repository.full_name }}" \
)" \
"${{ secrets.MEDASS_API_URL }}/github/workflow_failed"