Notify on Workflow Complete #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Notify on Workflow Complete | |
| on: | |
| workflow_run: | |
| workflows: [Verify and Test, VinylDNS Official Release] | |
| types: | |
| - completed | |
| jobs: | |
| notify: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Send Slack Notification On Success | |
| uses: slackapi/slack-github-action@v2.1.1 | |
| if: github.event.workflow_run.conclusion == 'success' | |
| with: | |
| method: chat.postMessage | |
| token: ${{ secrets.SLACK_BOT_TOKEN }} | |
| payload: | | |
| channel: ${{ secrets.SLACK_CHANNEL_ID }} | |
| text: "GitHub Action ${{ github.event.workflow.name }} completed successfully! Action: ${{ github.event.workflow_run.html_url }}" | |
| - name: Send Slack Notification on Failure | |
| uses: slackapi/slack-github-action@v2.1.1 | |
| if: github.event.workflow_run.conclusion != 'success' | |
| with: | |
| method: chat.postMessage | |
| token: ${{ secrets.SLACK_BOT_TOKEN }} | |
| payload: | | |
| channel: ${{ secrets.SLACK_CHANNEL_ID }} | |
| text: "GitHub Action ${{ github.event.workflow.name }} FAILED! Action: ${{ github.event.workflow_run.html_url }}" |