Skip to content

Commit 5830dfb

Browse files
committed
fix: notify slack on master
1 parent 791555d commit 5830dfb

File tree

2 files changed

+50
-12
lines changed

2 files changed

+50
-12
lines changed

.github/workflows/dhis2-verify-lib.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,16 @@ jobs:
7575
- name: Lint
7676
run: yarn lint
7777

78+
- name: Slack notify
79+
uses: ./.github/workflows/slack-notify.yml
80+
if: |
81+
always() &&
82+
github.ref == 'refs/heads/fix/action-slack'
83+
with:
84+
status: {{ job.status }}
85+
# needs: [build, lint, test, e2e, publish]
86+
# needs: [build, lint]
87+
7888
test:
7989
runs-on: ubuntu-latest
8090
needs: [build]
@@ -191,15 +201,4 @@ jobs:
191201
publish-github: true
192202
github-token: ${{ env.GH_TOKEN }}
193203
npm-token: ${{ env.NPM_TOKEN }}
194-
195-
send-slack-message:
196-
runs-on: ubuntu-latest
197-
if: ${{ always() && github.ref == 'refs/heads/master' }}
198-
needs: [build, lint, test, e2e, publish]
199-
steps:
200-
- uses: rtCamp/action-slack-notify@v2
201-
env:
202-
SLACK_WEBHOOK: ${{ secrets.SLACK_BACKEND_WEBHOOK }}
203-
SLACK_CHANNEL: 'team-extensibility-notifications'
204-
SLACK_MESSAGE_ON_FAILURE: 'Master branch failed to build or publish the UI library.'
205-
SLACK_COLOR: ${{ job.status }}
204+

.github/workflows/slack-notify.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Reusable workflow example
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
status:
7+
required: true
8+
type: string
9+
# secrets:
10+
# webhook:
11+
# default: ${{ secrets.SLACK_EXTENSIBILITY_WEBHOOK }}
12+
# required: true
13+
14+
jobs:
15+
send-slack-message:
16+
runs-on: ubuntu-latest
17+
# if: |
18+
# always() &&
19+
# github.ref == 'refs/heads/fix/action-slack'
20+
# # needs: [build, lint, test, e2e, publish]
21+
# needs: [build, lint]
22+
steps:
23+
- uses: rtCamp/action-slack-notify@v2
24+
with:
25+
SLACK_USERNAME: 'dhis2-bot'
26+
SLACK_CHANNEL: 'team-extensibility-notifications'
27+
SLACK_MESSAGE: ${{ inputs.status }}
28+
SLACK_MESSAGE_ON_FAILURE: 'Master branch failed to build or publish the UI library.'
29+
SLACK_COLOR: ${{ inputs.status }}
30+
env:
31+
SLACK_WEBHOOK: ${{ secrets.SLACK_EXTENSIBILITY_WEBHOOK }}
32+
33+
# triage:
34+
# runs-on: ubuntu-latest
35+
# steps:
36+
# - uses: actions/labeler@v4
37+
# with:
38+
# repo-token: ${{ secrets.token }}
39+
# configuration-path: ${{ inputs.config-path }}

0 commit comments

Comments
 (0)