Skip to content

Commit 8cbccca

Browse files
author
mdrum
committed
use newer slackapi action
1 parent f6369e9 commit 8cbccca

File tree

1 file changed

+30
-54
lines changed

1 file changed

+30
-54
lines changed

.github/workflows/build-staging-and-prod.yml

Lines changed: 30 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -182,64 +182,40 @@ jobs:
182182
183183
- name: Send Slack notification (success)
184184
if: steps.status.outputs.is_success == 'true'
185-
uses: slackapi/slack-github-action@v1
185+
uses: slackapi/slack-github-action@v2.1.1
186186
with:
187-
webhookUrl: ${{ secrets.SLACK_WEBHOOK_URL }}
187+
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
188+
webhook-type: incoming-webhook
188189
payload: |
189-
{
190-
"text": "✅ Archive Site updated successfully",
191-
"blocks": [
192-
{
193-
"type": "section",
194-
"text": {
195-
"type": "mrkdwn",
196-
"text": "✅ *Archive Site updated successfully*\n\nYour changes have been deployed to the staging site:\n<${{ steps.pages_url.outputs.url }}|View staging site>"
197-
}
198-
}
199-
]
200-
}
190+
text: "✅ Site updated successfully"
191+
blocks:
192+
- type: section
193+
text:
194+
type: mrkdwn
195+
text: "✅ *Site updated successfully*\n\nYour changes have been deployed to the staging site:\n<${{ steps.pages_url.outputs.url }}|View staging site>"
201196
202197
- name: Send Slack notification (failure)
203198
if: steps.status.outputs.is_success == 'false'
204-
uses: slackapi/slack-github-action@v1
199+
uses: slackapi/slack-github-action@v2.1.1
205200
with:
206-
webhookUrl: ${{ secrets.SLACK_WEBHOOK_URL }}
201+
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
202+
webhook-type: incoming-webhook
207203
payload: |
208-
{
209-
"text": "❌ Build & Deploy Failed",
210-
"blocks": [
211-
{
212-
"type": "header",
213-
"text": {
214-
"type": "plain_text",
215-
"text": "❌ Build & Deploy Failed"
216-
}
217-
},
218-
{
219-
"type": "section",
220-
"fields": [
221-
{
222-
"type": "mrkdwn",
223-
"text": "*Repository:*\n${{ github.repository }}"
224-
},
225-
{
226-
"type": "mrkdwn",
227-
"text": "*Branch:*\n${{ github.ref_name }}"
228-
},
229-
{
230-
"type": "mrkdwn",
231-
"text": "*Commit:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>"
232-
}
233-
]
234-
},
235-
{
236-
"type": "context",
237-
"elements": [
238-
{
239-
"type": "mrkdwn",
240-
"text": "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View workflow run for details>"
241-
}
242-
]
243-
}
244-
]
245-
}
204+
text: "❌ Build & Deploy Failed"
205+
blocks:
206+
- type: header
207+
text:
208+
type: plain_text
209+
text: "❌ Build & Deploy Failed"
210+
- type: section
211+
fields:
212+
- type: mrkdwn
213+
text: "*Repository:*\n${{ github.repository }}"
214+
- type: mrkdwn
215+
text: "*Branch:*\n${{ github.ref_name }}"
216+
- type: mrkdwn
217+
text: "*Commit:*\n<${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }}|${{ github.sha }}>"
218+
- type: context
219+
elements:
220+
- type: mrkdwn
221+
text: "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View workflow run for details>"

0 commit comments

Comments
 (0)