Skip to content

Commit

Permalink
major: update slack messages (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
venkatamutyala authored Oct 7, 2024
1 parent 9b8815b commit ed17c5f
Showing 1 changed file with 42 additions and 7 deletions.
49 changes: 42 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

0 comments on commit ed17c5f

Please sign in to comment.