-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b8815b
commit ed17c5f
Showing
1 changed file
with
42 additions
and
7 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 |
---|---|---|
|
@@ -145,11 +145,22 @@ runs: | |
if: github.ref_name == 'main' && steps.plan.outputs.changes == 'true' && inputs.enable_slack_notification_for_approval == 'true' && github.event_name != 'pull_request' | ||
uses: slackapi/[email protected] | ||
with: | ||
# For posting a rich message using Block Kit | ||
payload: | | ||
{ | ||
"color": "#FFA500", | ||
"text": "__\n\n\n${{ github.repository }} \n*Pending approval:* @${{ github.actor }} \nhttps://github.com/${{ github.repository }}/issues \n_Note: Find the relevant GitHub issue and approve with a comment_ \nView Job/Status: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | ||
"text": "Workflow needs approval", | ||
"attachments": [ | ||
{ | ||
"pretext": "View Job/Status: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", | ||
"color": "dbab09", | ||
"fields": [ | ||
{ | ||
"title": "{{ github.repository }}", | ||
"short": true, | ||
"value": "Approval Required: https://github.com/${{ github.repository }}/issues " | ||
} | ||
] | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | ||
|
@@ -191,8 +202,20 @@ runs: | |
with: | ||
payload: | | ||
{ | ||
"color": "good", | ||
"text": "__\n\n\n*${{ github.repository }}* - Workflow Succeeded. \nView Job/Status: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | ||
"text": "Workflow - SUCCESS", | ||
"attachments": [ | ||
{ | ||
"pretext": "View Job/Status: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", | ||
"color": "00FF00", | ||
"fields": [ | ||
{ | ||
"title": "{{ github.repository }}", | ||
"short": true, | ||
"value": "SUCCESS" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | ||
|
@@ -204,8 +227,20 @@ runs: | |
with: | ||
payload: | | ||
{ | ||
"color": "danger", | ||
"text": "__\n\n\n*${{ github.repository }}* - Workflow FAILED. \nView Job/Status: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" | ||
"text": "Workflow - FAILURE", | ||
"attachments": [ | ||
{ | ||
"pretext": "View Job/Status: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}", | ||
"color": "FF0000", | ||
"fields": [ | ||
{ | ||
"title": "{{ github.repository }}", | ||
"short": true, | ||
"value": "FAILURE" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK |