Skip to content

Notify on Workflow Complete #1

Notify on Workflow Complete

Notify on Workflow Complete #1

Workflow file for this run

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