-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (82 loc) · 2.52 KB
/
notify-start.yaml
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Notify start
on:
workflow_call:
inputs:
app_index:
required: true
type: number
description: Application settings index
channel_id:
required: true
type: string
description: Slack channel id
message_id:
required: false
type: string
default: ''
description: Slack message id
phase:
required: true
type: number
description: Build phase index
step:
required: true
type: string
description: Step notification step
slack_phase_state:
required: true
type: string
description: Slack notification state
slack_artifact_name:
required: true
type: string
description: Github artifact name containing slack template
slack_template_file:
required: true
type: string
description: Slack message template file name
slack_template_dir:
required: false
type: string
default: /tmp/slack
description: Template file directory
outputs:
slack_state:
value: ${{ jobs.notify.outputs.slack_state }}
description: Slack state
slack_message_id:
value: ${{ jobs.notify.outputs.slack_message_id }}
description: Slack message id
jobs:
notify:
name: Compose and send Slack message
runs-on: ubuntu-latest
outputs:
slack_state: ${{ steps.notification.outputs.state }}
slack_message_id: ${{ steps.slack.outputs.ts }}
steps:
-
name: Download notification template
uses: actions/download-artifact@v3
with:
name: ${{ inputs.slack_artifact_name }}-${{ inputs.app_index }}-${{ github.run_id }}
path: ${{ inputs.slack_template_dir }}
-
name: Add start notification step
id: notification
uses: Geta/gks/actions/add-notification-step@v5
with:
template_path: ${{ inputs.slack_template_dir }}/${{ inputs.slack_template_file }}
phase: ${{ inputs.phase }}
step: ":hourglass: *${{ inputs.step }}*"
state: ${{ inputs.slack_phase_state }}
-
name: Send Slack notification
id: slack
uses: slackapi/slack-github-action@v1
with:
channel-id: ${{ inputs.channel_id }}
update-ts: ${{ inputs.message_id }}
payload-file-path: ${{ inputs.slack_template_dir }}/${{ inputs.slack_template_file }}
env:
SLACK_BOT_TOKEN: ${{ secrets.GKS_GCC_SLACK_BOT_TOKEN }}