Skip to content

Commit 247a83b

Browse files
ci: PLT-632: Failed scheduled tests notification
1 parent 08c278a commit 247a83b

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.github/workflows/tests.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ env:
2727
DOCKER_BUILD_CONFIG_BRANCH: "master"
2828
DOCKER_BUILD_CONFIG_PATH: ".github/docker-build-config.yml"
2929
DOCKER_EXAMPLES_DIRECTORY: "label_studio_ml/examples"
30+
SLACK_NOTIFICATION_CHANNEL_ID: "CKL2D6D2P"
3031

3132
jobs:
3233
run_pytest:
@@ -241,3 +242,24 @@ jobs:
241242
env:
242243
PR_URL: ${{ github.event.pull_request.html_url }}
243244
GITHUB_TOKEN: ${{ secrets.GIT_PAT }}
245+
246+
notification:
247+
name: "Send Slack Notification"
248+
if: failure() && github.event_name == 'schedule'
249+
runs-on: ubuntu-latest
250+
needs:
251+
- run_pytest
252+
steps:
253+
- name: Send Slack Notification
254+
if: always()
255+
uses: slackapi/[email protected]
256+
env:
257+
WORKFLOW: "<https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|workflow>"
258+
with:
259+
method: chat.postMessage
260+
token: ${{ secrets.SLACK_LSE_BOT_TOKEN }}
261+
payload: |
262+
channel: "${{ env.SLACK_NOTIFICATION_CHANNEL_ID }}"
263+
text: >+
264+
:x: Scheduled test workflow failed
265+
[ ${{ env.WORKFLOW }} ]

0 commit comments

Comments
 (0)