Skip to content

Commit 2fcba96

Browse files
ci: PLT-632: Failed build notification
1 parent 247a83b commit 2fcba96

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.github/workflows/build.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ env:
1313
DOCKER_BUILD_CONFIG_BRANCH: "master"
1414
DOCKER_BUILD_CONFIG_PATH: ".github/docker-build-config.yml"
1515
DOCKER_EXAMPLES_DIRECTORY: "label_studio_ml/examples"
16+
SLACK_NOTIFICATION_CHANNEL_ID: "CKL2D6D2P"
1617

1718
jobs:
1819
build-image:
@@ -151,3 +152,24 @@ jobs:
151152
const docker_build_config = yaml.load(docker_build_config_content);
152153
153154
core.setOutput("matrix-include", docker_build_config);
155+
156+
notification:
157+
name: "Send Slack Notification"
158+
if: failure()
159+
runs-on: ubuntu-latest
160+
needs:
161+
- build-image
162+
steps:
163+
- name: Send Slack Notification
164+
if: always()
165+
uses: slackapi/[email protected]
166+
env:
167+
WORKFLOW: "<https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|workflow>"
168+
with:
169+
method: chat.postMessage
170+
token: ${{ secrets.SLACK_LSE_BOT_TOKEN }}
171+
payload: |
172+
channel: "${{ env.SLACK_NOTIFICATION_CHANNEL_ID }}"
173+
text: >+
174+
:x: Build workflow failed
175+
[ ${{ env.WORKFLOW }} ]

0 commit comments

Comments
 (0)