-
Notifications
You must be signed in to change notification settings - Fork 184
136 lines (134 loc) · 4.49 KB
/
develop.yml
File metadata and controls
136 lines (134 loc) · 4.49 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Development run
# Requires mocking the "public" event to begin this workflow and avoid actual runs
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
on:
public:
jobs:
run:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout action
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup the Node runtime for this project
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
cache: npm
cache-dependency-path: package-lock.json
node-version-file: .nvmrc
- name: Install dependencies
run: npm install
- name: Package the build
run: npm run build
- name: Start a workflow with a webhook trigger
id: wfb
uses: ./
with:
errors: true
webhook: ${{ secrets.SLACK_WEBHOOK_TRIGGER }}
webhook-type: webhook-trigger
payload: |
author: ${{ github.event.sender.login }}
channel_id: ${{ secrets.SLACK_CHANNEL_ID }}
event_url: ${{ github.event.pull_request.html_url }}
repo_name: ${{ github.event.repository.full_name }}
status: ${{ job.status }}
- name: Post a token message into channel
id: api
uses: ./
with:
errors: true
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
channel: ${{ secrets.SLACK_CHANNEL_ID }}
text: ":checkered_flag: Action happens at <https://github.com/${{ github.repository }}>"
- name: Initiate the deployment sequence
id: slack
uses: ./
with:
errors: true
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
channel: ${{ secrets.SLACK_CHANNEL_ID }}
text: ":eyes: Testing started..."
attachments:
- color: "dbab09"
fields:
- title: "Status"
short: true
value: "In Progress"
- name: Write starting statistics
id: stats
uses: ./
with:
errors: true
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
channel: ${{ steps.slack.outputs.channel_id }}
text: "Started at `${{ steps.slack.outputs.time }}`"
thread_ts: "${{ steps.slack.outputs.ts }}"
- name: Countdown
run: sleep 3
- name: Launch time is now
id: finished
uses: ./
with:
errors: true
method: chat.update
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
channel: ${{ secrets.SLACK_CHANNEL_ID }}
ts: "${{ steps.slack.outputs.ts }}"
text: ":microscope: Testing finished!"
attachments:
- color: "28a745"
fields:
- title: "Status"
short: true
value: "Completed"
- name: Include ending statistics
uses: ./
with:
errors: true
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
channel: ${{ steps.slack.outputs.channel_id }}
text: "Finished at `${{ steps.finished.outputs.time }}`"
thread_ts: "${{ steps.stats.outputs.thread_ts }}"
- name: Celebrate wins
uses: ./
with:
errors: true
method: reactions.add
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
channel: ${{ secrets.SLACK_CHANNEL_ID }}
timestamp: ${{ steps.slack.outputs.ts }}
name: "eye-in-speech-bubble"
- name: Upload this workflow file
id: file
uses: ./
with:
errors: true
method: files.uploadV2
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
channel_id: ${{ secrets.SLACK_CHANNEL_ID }}
initial_comment: ":robot_face: The codes exists here"
file: .github/workflows/develop.yml
filename: action.yml
- name: Write one final webhook
uses: ./
with:
errors: true
webhook: ${{ secrets.SLACK_INCOMING_WEBHOOK }}
webhook-type: incoming-webhook
payload: |
text: "end."