From fdfb70a3d02d7d69edb7bfa6baf489cafc17fd97 Mon Sep 17 00:00:00 2001 From: Steve Riesenberg <5248162+sjohnr@users.noreply.github.com> Date: Wed, 15 Jan 2025 14:45:52 -0600 Subject: [PATCH] Send notification only on failure or cancelled Closes gh-59 --- .github/actions/send-notification/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/send-notification/action.yml b/.github/actions/send-notification/action.yml index a084b53..4592a7e 100644 --- a/.github/actions/send-notification/action.yml +++ b/.github/actions/send-notification/action.yml @@ -63,5 +63,6 @@ runs: # Output status echo "result=$runStatus" >> $GITHUB_OUTPUT - shell: bash + if: ${{ contains(fromJSON('["failed", "cancelled", "unsuccessful"]'), steps.run-info.outputs.result) }} run: | curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ "text": "${{ env.WORKFLOW_STATUS }}\n${{ env.WORKFLOW_INFO }}: ${{ env.RUN_INFO }}\n\n${{ env.JOB_INFO }}" }' || true