Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/notify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Notify on Workflow Complete

on:
workflow_run:
workflows: [verify, release]
types:
- completed

jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Send Slack Notification On Success
uses: slackapi/slack-github-action@v1.18.0
if: github.event.workflow_run.conclusion == 'success'
with:
# For posting a rich message using Block Kit
payload: |
{
"text": "[vinyldns-java] ${{ github.event.workflow.name }} workflow completed successfully!\nAction: ${{ github.event.workflow_run.html_url }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":check_mark: [vinyldns-java] `${{ github.event.workflow.name }}` workflow completed successfully!\nAction: ${{ github.event.workflow_run.html_url }}"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

- name: Send Slack Notification on Failure
uses: slackapi/slack-github-action@v1.18.0
if: github.event.workflow_run.conclusion != 'success'
with:
# For posting a rich message using Block Kit
payload: |
{
"text": "[vinyldns-java] ${{ github.event.workflow.name }} FAILED!\nAction: ${{ github.event.workflow_run.html_url }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":x: [vinyldns-java] `${{ github.event.workflow.name }}` FAILED!\nAction: ${{ github.event.workflow_run.html_url }}"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK