Skip to content

Commit

Permalink
Refactor failure reporting code
Browse files Browse the repository at this point in the history
  • Loading branch information
orome committed Nov 6, 2023
1 parent 14dc2fd commit 8f797bd
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/test-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -248,19 +248,21 @@ jobs:
id: failed_job
run: |
if [ ${{ contains(needs.test.result, 'failure') }} == 'true' ]; then
echo "FAILED_JOB=Tests" >> $GITHUB_OUTPUT
FAILED_JOB="Tests"
fi
if [ ${{ contains(needs.validate_version.result, 'failure') }} == 'true' ]; then
echo "FAILED_JOB=Version Validation" >> $GITHUB_OUTPUT
FAILED_JOB="Version Validation"
fi
if [ ${{ contains(needs.validate_tag.result, 'failure') }} == 'true' ]; then
echo "FAILED_JOB=Tag Validation" >> $GITHUB_OUTPUT
FAILED_JOB="Tag Validation"
fi
if [ ${{ contains(needs.publish.result, 'failure') }} == 'true' ]; then
echo "FAILED_JOB=PyPI Publication" >> $GITHUB_OUTPUT
FAILED_JOB="Publication"
fi
echo "FAILED_JOB=${FAILED_JOB}" >> $GITHUB_OUTPUT
echo "${FAILED_JOB} Failure!"
- name: Discord failure notification
- name: Post Discord failure notification
uses: tsickert/discord-webhook@v5.3.0
with:
webhook-url: ${{ secrets.DISCORD_CODING_WEBHOOK_URL }}
Expand Down

0 comments on commit 8f797bd

Please sign in to comment.