-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for custom payloads and additional 'status' values.
- Loading branch information
1 parent
0aaaa49
commit 68fae91
Showing
2 changed files
with
101 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Test Slack Workflow Notifications | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- '*' | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
test-slack-workflow-notifications: | ||
runs-on: ubuntu-latest | ||
name: Test slack-actions/workflow-notifications | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Post 'success' notification | ||
uses: ./slack-actions/workflow-notification | ||
with: | ||
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_NOTIFY_SLACK_NOTIFICATION_TEST }} | ||
status: 'success' | ||
success-message: ":test_tube: [TEST]: This is a test *success* notification from `Kong/public-shared-actions`" | ||
|
||
- name: Post 'failure' notification | ||
uses: ./slack-actions/workflow-notification | ||
with: | ||
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_ALERT_SLACK_NOTIFICATION_TEST }} | ||
status: 'failure' | ||
failure-message: ":test_tube: [TEST]: This is a test *failure* notification from `Kong/public-shared-actions`" | ||
|
||
- name: Post 'success' notification with custom payload | ||
uses: ./slack-actions/workflow-notification | ||
with: | ||
slack-webhook-url: ${{ secrets.SLACK_WEBHOOK_URL_NOTIFY_SLACK_NOTIFICATION_TEST }} | ||
status: 'success' | ||
payload: | | ||
{ | ||
"blocks": [ | ||
{ | ||
"type": "header", | ||
"text": { | ||
"type": "plain_text", | ||
"text": "[TEST] Kong/public-shared-actions", | ||
"emoji": true | ||
} | ||
}, | ||
{ | ||
"type": "context", | ||
"elements": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": ":test_tube:" | ||
}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "This is a test notification with a *custom payload*." | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains 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