Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Slack notification for verify and test #15

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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: [Node.js CI]
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-bot] ${{ github.event.workflow.name }} workflow completed successfully!\nAction: ${{ github.event.workflow_run.html_url }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":check_mark: [vinyldns-bot] `${{ 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-bot] ${{ github.event.workflow.name }} FAILED!\nAction: ${{ github.event.workflow_run.html_url }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":x: [vinyldns-bot] `${{ github.event.workflow.name }}` FAILED!\nAction: ${{ github.event.workflow_run.html_url }}"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK