-
-
Notifications
You must be signed in to change notification settings - Fork 3
35 lines (32 loc) · 1.17 KB
/
notify.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: Notify build status on Slack
on:
workflow_call:
secrets:
SLACK_WEBHOOK_URL:
required: true
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Send notification on Slack
uses: rtCamp/[email protected]
if: ${{ success() }}
env:
SLACK_CHANNEL: ${{ vars.SLACK_GITHUB_ACTIONS_CHANNEL_NAME }}
SLACK_COLOR: ${{ job.status }}
SLACK_ICON: ${{ vars.SLACK_GITHUB_ACTIONS_ICON_URL }}
SLACK_MESSAGE: ':white_check_mark: Build successful! :rocket:'
SLACK_TITLE: CZAN build status
SLACK_USERNAME: Github Actions CI
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
- name: Send notification on Slack
uses: rtCamp/[email protected]
if: ${{ failure() }}
env:
SLACK_CHANNEL: ${{ vars.SLACK_GITHUB_ACTIONS_CHANNEL_NAME }}
SLACK_COLOR: ${{ job.status }}
SLACK_ICON: ${{ vars.SLACK_GITHUB_ACTIONS_ICON_URL }}
SLACK_MESSAGE: ':x: Build failed! :pensive:'
SLACK_TITLE: CZAN build status
SLACK_USERNAME: Github Actions CI
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}