-
Notifications
You must be signed in to change notification settings - Fork 2
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
ba2075a
commit dfd2c2d
Showing
1 changed file
with
181 additions
and
32 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 |
---|---|---|
|
@@ -37,20 +37,44 @@ jobs: | |
channel-id: ${{ inputs.slack_channel_id }} | ||
payload: | | ||
{ | ||
"text": "${{ inputs.msg }}", | ||
"attachments": [ | ||
{ | ||
"color": "dbab09", | ||
"fields": [ | ||
"blocks": [ | ||
{ | ||
"title": "Status", | ||
"short": true, | ||
"value": "In Progress" | ||
"type": "header", | ||
"text": { | ||
"type": "plain_text", | ||
"text": "In progress" | ||
} | ||
}, | ||
{ | ||
"title": "Run", | ||
"short": true, | ||
"value": "${{ env.RUN_URL }}" | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "${{ inputs.msg }}" | ||
} | ||
}, | ||
{ | ||
"type": "divider" | ||
}, | ||
{ | ||
"type": "context", | ||
"elements": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "status update by ${{ github.actor }} from ${{ github.repository }}." | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "context", | ||
"elements": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "<${{ env.RUN_URL }}|check logs> on Github Action" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
|
@@ -66,20 +90,44 @@ jobs: | |
channel-id: ${{ inputs.slack_channel_id }} | ||
payload: | | ||
{ | ||
"text": "${{ inputs.msg }}", | ||
"attachments": [ | ||
{ | ||
"color": "28a745", | ||
"fields": [ | ||
"blocks": [ | ||
{ | ||
"title": "Status", | ||
"short": true, | ||
"value": "Success" | ||
"type": "header", | ||
"text": { | ||
"type": "plain_text", | ||
"text": "Success" | ||
} | ||
}, | ||
{ | ||
"title": "Run", | ||
"short": true, | ||
"value": "${{ env.RUN_URL }}" | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "${{ inputs.msg }}" | ||
} | ||
}, | ||
{ | ||
"type": "divider" | ||
}, | ||
{ | ||
"type": "context", | ||
"elements": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "status update by ${{ github.actor }} from ${{ github.repository }}." | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "context", | ||
"elements": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "<${{ env.RUN_URL }}|check logs> on Github Action" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
|
@@ -95,20 +143,44 @@ jobs: | |
channel-id: ${{ inputs.slack_channel_id }} | ||
payload: | | ||
{ | ||
"text": "${{ inputs.msg }}", | ||
"attachments": [ | ||
{ | ||
"color": "bc0d24", | ||
"fields": [ | ||
"blocks": [ | ||
{ | ||
"title": "Status", | ||
"short": true, | ||
"value": "Failure" | ||
"type": "header", | ||
"text": { | ||
"type": "plain_text", | ||
"text": "Failure" | ||
} | ||
}, | ||
{ | ||
"title": "Run", | ||
"short": true, | ||
"value": "${{ env.RUN_URL }}" | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "${{ inputs.msg }}" | ||
} | ||
}, | ||
{ | ||
"type": "divider" | ||
}, | ||
{ | ||
"type": "context", | ||
"elements": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "status update by ${{ github.actor }} from ${{ github.repository }}." | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "context", | ||
"elements": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "<${{ env.RUN_URL }}|check logs> on Github Action" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
|
@@ -124,20 +196,97 @@ jobs: | |
channel-id: ${{ inputs.slack_channel_id }} | ||
payload: | | ||
{ | ||
"text": "${{ inputs.msg }}", | ||
"attachments": [ | ||
{ | ||
"color": "808080", | ||
"fields": [ | ||
"blocks": [ | ||
{ | ||
"type": "header", | ||
"text": { | ||
"type": "plain_text", | ||
"text": "Cancelled" | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "${{ inputs.msg }}" | ||
} | ||
}, | ||
{ | ||
"type": "divider" | ||
}, | ||
{ | ||
"type": "context", | ||
"elements": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "status update by ${{ github.actor }} from ${{ github.repository }}." | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "context", | ||
"elements": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "<${{ env.RUN_URL }}|check logs> on Github Action" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
env: | ||
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | ||
|
||
- name: Post skipped msg to Slack | ||
if: inputs.status == 'skipped' | ||
uses: slackapi/[email protected] | ||
with: | ||
channel-id: ${{ inputs.slack_channel_id }} | ||
payload: | | ||
{ | ||
"attachments": [ | ||
{ | ||
"color": "808080", | ||
"blocks": [ | ||
{ | ||
"type": "header", | ||
"text": { | ||
"type": "plain_text", | ||
"text": "Skipped" | ||
} | ||
}, | ||
{ | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "${{ inputs.msg }}" | ||
} | ||
}, | ||
{ | ||
"type": "divider" | ||
}, | ||
{ | ||
"title": "Status", | ||
"short": true, | ||
"value": "Cancelled" | ||
"type": "context", | ||
"elements": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "status update by ${{ github.actor }} from ${{ github.repository }}." | ||
} | ||
] | ||
}, | ||
{ | ||
"title": "Run", | ||
"short": true, | ||
"value": "${{ env.RUN_URL }}" | ||
"type": "context", | ||
"elements": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "<${{ env.RUN_URL }}|check logs> on Github Action" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
|