generated from actions/typescript-action
-
-
Notifications
You must be signed in to change notification settings - Fork 53
283 lines (262 loc) · 7.61 KB
/
examples.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
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
name: "examples"
on: [push]
jobs:
# make sure the action works on a clean machines without building
## Basic
test_basic_success:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Test Basic Success
conclusion: success
test_basic_success_with_output:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Test Basic Success (Implicit)
conclusion: success
output: |
{"summary":"Test was a success","text_description":"This is a text description of the annotations and images\nWith more stuff\nAnd more"}
test_basic_failure:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Test Basic Failure
conclusion: failure
# Other codes
test_basic_neutral:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Test Basic Neutral
conclusion: neutral
test_basic_cancelled:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Test Basic Cancelled
conclusion: cancelled
test_basic_timed_out:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Test Basic Timed Out
conclusion: timed_out
test_basic_action_required:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Test Basic Action Required
conclusion: action_required
action_url: https://example.com/action
details_url: https://example.com/details
test_basic_skipped:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Test Basic Skipped
conclusion: skipped
test_basic_stale:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Test Basic Stale
conclusion: stale
# With details
test_with_details:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Test With Details
conclusion: success
action_url: https://example.com/action
details_url: https://example.com/details
## With annotations
test_with_annotations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Test With Annotations
conclusion: success
# output.summary is required with actions!
output: |
{"summary":"Some warnings in README.md"}
annotations: |
[{"path":"README.md","annotation_level":"warning","title":"Spell Checker","message":"Check your spelling for 'banaas'.","raw_details":"Do you mean 'bananas' or 'banana'?","start_line":1,"end_line":2}]
test_with_annotations_from_run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: annotations
run: |
echo "value=$ANNOTATIONS" >> $GITHUB_OUTPUT
env:
ANNOTATIONS: |
[{"path":"README.md","start_line":1,"end_line":2,"message":"Check your spelling for 'banaas'.","annotation_level":"warning"}]
- uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Test With Annotations From Run
conclusion: success
# output.summary is required with actions!
output: |
{"summary":"Some warnings in README.md"}
annotations: ${{ steps.annotations.outputs.value }}
## With images
test_with_images:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Test With Images
conclusion: success
# output.summary is required with actions!
output: |
{"summary":"Some cool pics"}
images: |
[{"alt":"Cool pic","image_url":"https://via.placeholder.com/150","caption":"Cool description"}]
test_with_images_from_run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: images
run: |
echo "value=$IMAGES" >> $GITHUB_OUTPUT
env:
IMAGES: |
[{"alt":"Cool pic","image_url":"https://via.placeholder.com/150","caption":"Cool description"}]
- uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Test With Images From Run
conclusion: success
# output.summary is required with actions!
output: |
{"summary":"Some warnings in README.md"}
images: ${{ steps.images.outputs.value }}
## With actions
test_with_actions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Test With Actions
conclusion: success
action_url: https://example.com/action
details_url: https://example.com/details
actions: |
[{"label":"Click Me","description":"Click me to get free RAM","identifier":"sent_to_webhook"}]
test_with_actions_from_run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: actions
run: |
echo "value=$ACTIONS" >> $GITHUB_OUTPUT
env:
ACTIONS: |
[{"label":"Click Me","description":"Click me to get free RAM","identifier":"sent_to_webhook"}]
- uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Test With Actions From Run
conclusion: success
action_url: https://example.com/action
# output.summary is required with actions!
output: |
{"summary":"Some warnings in README.md"}
actions: ${{ steps.actions.outputs.value }}
## With init
test_with_init:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
id: init
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Test With Init
status: in_progress
- run: sleep 30
- uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
check_id: ${{ steps.init.outputs.check_id }}
status: completed
output: |
{"summary":"Some warnings in README.md"}
conclusion: failure
test_with_init_implicit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
id: init
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Test With Init (Implicit)
status: in_progress
- run: sleep 30
- uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
check_id: ${{ steps.init.outputs.check_id }}
conclusion: success
## Based on job
test_based_job_success:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Test Based On Job (Success)
conclusion: ${{ job.status }}
test_based_job_failure:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: false
- uses: ./
if: always()
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Test Based On Job (Failure)
conclusion: ${{ job.status }}