Skip to content

Commit 619e65f

Browse files
authored
ci: trigger webhook on nightly tests failure (#1727)
1 parent d8164d9 commit 619e65f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

.github/workflows/nightly.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,26 @@ jobs:
5353
SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }}
5454
SCW_DEFAULT_ORGANIZATION_ID: ${{ secrets.SCW_DEFAULT_ORGANIZATION_ID }}
5555
SCW_DEFAULT_PROJECT_ID: ${{ secrets.SCW_DEFAULT_PROJECT_ID }}
56+
- name: Ping on failure
57+
if: ${{ failure() }}
58+
run: |
59+
curl -X POST -H 'Content-type: application/json' \
60+
--data '{
61+
"blocks": [
62+
{
63+
"type": "section",
64+
"text": {
65+
"type": "mrkdwn",
66+
"text": "'"Nightly workflow failed: https://github.com/scaleway/terraform-provider-scaleway/actions/runs/${GITHUB_WORKFLOW_ID}"'"
67+
}
68+
}
69+
]
70+
}' \
71+
${SLACK_WEBHOOK_NIGHTLY};
72+
done
73+
env:
74+
SLACK_WEBHOOK_NIGHTLY: ${{ secrets.SLACK_WEBHOOK_NIGHTLY }}
75+
GITHUB_WORKFLOW_ID: ${{ github.workflow }}
5676

5777
# sweeper needs to run after nightly completed
5878
# no matter what are the results of the jobs

0 commit comments

Comments
 (0)