Skip to content

Commit d57e0a0

Browse files
Test notifications to new channels (#634)
test notifications to new channels
1 parent 718c57d commit d57e0a0

File tree

1 file changed

+46
-4
lines changed

1 file changed

+46
-4
lines changed

.github/workflows/notify-slack-on-failure.yml

+46-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,52 @@ jobs:
2323
footer: "Linked Repo <${{github.server_url}}/${{github.repository}}|${{github.repository}}> | <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View Failure>"
2424
env:
2525
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ALERT_WEBHOOK }}
26-
27-
on-success:
26+
on-success-test:
2827
runs-on: ubuntu-latest
2928
if: github.event.workflow_run.conclusion == 'success'
3029
steps:
31-
- run: ${{ tojson(github.event) }}
32-
shell: cat {0}
30+
# Deploy to existing slack alerts channel on success
31+
- uses: ravsamhq/notify-slack-action@v2
32+
with:
33+
status: ${{ github.event.workflow_run.conclusion }}
34+
notification_title: " ${{github.event.workflow_run.name}} - ${{github.event.workflow_run.conclusion}} on ${{github.event.workflow_run.head_branch}} - <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View Failure>"
35+
message_format: ":rocket: *${{github.event.workflow_run.name}}* ${{github.event.workflow_run.conclusion}} in <${{github.server_url}}/${{github.repository}}/${{github.event.workflow_run.head_branch}}|${{github.repository}}>"
36+
footer: "Linked Repo <${{github.server_url}}/${{github.repository}}|${{github.repository}}> | <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View Failure>"
37+
env:
38+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_ALERT_WEBHOOK }}
39+
# Deploy to new preprod slack deployments channel on success
40+
- uses: ravsamhq/notify-slack-action@v2
41+
with:
42+
status: ${{ github.event.workflow_run.conclusion }}
43+
notification_title: " ${{github.event.workflow_run.name}} - ${{github.event.workflow_run.conclusion}} on ${{github.event.workflow_run.head_branch}} - <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View Failure>"
44+
message_format: ":rocket: *${{github.event.workflow_run.name}}* ${{github.event.workflow_run.conclusion}} in <${{github.server_url}}/${{github.repository}}/${{github.event.workflow_run.head_branch}}|${{github.repository}}>"
45+
footer: "Linked Repo <${{github.server_url}}/${{github.repository}}|${{github.repository}}> | <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View Failure>"
46+
env:
47+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_PREPROD_DEPLOYMENTS }}
48+
# Deploy to new prod slack deployments channel on success
49+
- uses: ravsamhq/notify-slack-action@v2
50+
with:
51+
status: ${{ github.event.workflow_run.conclusion }}
52+
notification_title: " ${{github.event.workflow_run.name}} - ${{github.event.workflow_run.conclusion}} on ${{github.event.workflow_run.head_branch}} - <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View Failure>"
53+
message_format: ":rocket: *${{github.event.workflow_run.name}}* ${{github.event.workflow_run.conclusion}} in <${{github.server_url}}/${{github.repository}}/${{github.event.workflow_run.head_branch}}|${{github.repository}}>"
54+
footer: "Linked Repo <${{github.server_url}}/${{github.repository}}|${{github.repository}}> | <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View Failure>"
55+
env:
56+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_PROD_DEPLOYMENTS }}
57+
# Deploy to new preprod teams deployments channel on success
58+
- uses: jdcargile/ms-teams-notification@v1.4
59+
with:
60+
github-token: ${{ github.token }} # this will use the runner's token.
61+
ms-teams-webhook-uri: ${{ secrets.TEAMS_WEBHOOK_PREPROD_DEPLOYMENTS }}
62+
notification-summary: "Deploying to Preprod"
63+
notification-color: 17a2b8
64+
timezone: Europe/London
65+
verbose-logging: true
66+
# Deploy to new prod teams deployments channel on success
67+
- uses: jdcargile/ms-teams-notification@v1.4
68+
with:
69+
github-token: ${{ github.token }} # this will use the runner's token.
70+
ms-teams-webhook-uri: ${{ secrets.TEAMS_WEBHOOK_PROD_DEPLOYMENTS }}
71+
notification-summary: "Deploying to Prod"
72+
notification-color: 17a2b8
73+
timezone: Europe/London
74+
verbose-logging: true

0 commit comments

Comments
 (0)