Skip to content

Commit 61ebb53

Browse files
committed
feat: announce release skip
1 parent faf1269 commit 61ebb53

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/create-github-release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ jobs:
9393
output-file: ${{ steps.prereleaseTag.outputs.tag && 'false' || 'CHANGELOG.md' }} # If prerelease, do not write the changelog file
9494

9595
- name: Create Github Release
96+
id: create-github-release
9697
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5
9798
if: ${{ steps.changelog.outputs.skipped == 'false' }}
9899
with:
@@ -103,3 +104,35 @@ jobs:
103104
prerelease: ${{ steps.prereleaseTag.outputs.tag && 'true' || 'false' }}
104105
token: ${{ secrets.SVC_CLI_BOT_GITHUB_TOKEN }}
105106
skipIfReleaseExists: true
107+
108+
- name: Announce Failure
109+
id: slack
110+
if: ${{ steps.create-github-release.outcome == 'success' && steps.create-github-release.outputs.id == '' }}
111+
uses: slackapi/slack-github-action@v1.26.0
112+
env:
113+
# for non-CLI-team-owned plugins, you can send this anywhere you like
114+
SLACK_WEBHOOK_URL: ${{ secrets.CLI_ALERTS_SLACK_WEBHOOK }}
115+
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
116+
with:
117+
# Payload can be visually tested here: https://app.slack.com/block-kit-builder/T01GST6QY0G#%7B%22blocks%22:%5B%5D%7D
118+
# Only copy over the "blocks" array to the Block Kit Builder
119+
payload: |
120+
{
121+
"text": "Workflow \"${{ github.event.workflow_run.name }}\" failed in ${{ github.event.workflow_run.repository.name }}",
122+
"blocks": [
123+
{
124+
"type": "header",
125+
"text": {
126+
"type": "plain_text",
127+
"text": ":uno-skip: Github Release was skipped in ${{ github.event.workflow_run.repository.name }}! :uno-skip:"
128+
}
129+
},
130+
{
131+
"type": "section",
132+
"text": {
133+
"type": "mrkdwn",
134+
"text": "*Repo:* ${{ github.event.workflow_run.repository.html_url }}\n*Workflow name:* `${{ github.event.workflow_run.name }}`\n*Job url:* ${{ github.event.workflow_run.html_url }}"
135+
}
136+
}
137+
]
138+
}

0 commit comments

Comments
 (0)