Skip to content

Commit 41b1e1a

Browse files
authored
Bump action versions, fix tag step in release, regen js (#149)
* patch: bump assert-action to latest version * patch: only attempt to move the major version tag if a new release published
1 parent 3610882 commit 41b1e1a

File tree

2 files changed

+44
-38
lines changed

2 files changed

+44
-38
lines changed

.github/workflows/ci_cd.yml

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
timeout_minutes: 1
4949
max_attempts: 2
5050
command: npm -v
51-
- uses: nick-fields/assert-action@v1
51+
- uses: nick-fields/assert-action@v2
5252
with:
5353
expected: true
5454
actual: ${{ steps.happy_path.outputs.total_attempts == '1' && steps.happy_path.outputs.exit_code == '0' }}
@@ -67,11 +67,11 @@ jobs:
6767
timeout_minutes: 1
6868
max_attempts: 2
6969
command: node -e "process.exit(1)"
70-
- uses: nick-fields/assert-action@v1
70+
- uses: nick-fields/assert-action@v2
7171
with:
7272
expected: 2
7373
actual: ${{ steps.sad_path_error.outputs.total_attempts }}
74-
- uses: nick-fields/assert-action@v1
74+
- uses: nick-fields/assert-action@v2
7575
with:
7676
expected: failure
7777
actual: ${{ steps.sad_path_error.outcome }}
@@ -85,15 +85,15 @@ jobs:
8585
max_attempts: 3
8686
retry_on: timeout
8787
command: node -e "process.exit(2)"
88-
- uses: nick-fields/assert-action@v1
88+
- uses: nick-fields/assert-action@v2
8989
with:
9090
expected: 1
9191
actual: ${{ steps.retry_on_timeout_fail.outputs.total_attempts }}
92-
- uses: nick-fields/assert-action@v1
92+
- uses: nick-fields/assert-action@v2
9393
with:
9494
expected: failure
9595
actual: ${{ steps.retry_on_timeout_fail.outcome }}
96-
- uses: nick-fields/assert-action@v1
96+
- uses: nick-fields/assert-action@v2
9797
with:
9898
expected: 2
9999
actual: ${{ steps.retry_on_timeout_fail.outputs.exit_code }}
@@ -107,15 +107,15 @@ jobs:
107107
max_attempts: 2
108108
retry_on: error
109109
command: node -e "process.exit(2)"
110-
- uses: nick-fields/assert-action@v1
110+
- uses: nick-fields/assert-action@v2
111111
with:
112112
expected: 2
113113
actual: ${{ steps.retry_on_error.outputs.total_attempts }}
114-
- uses: nick-fields/assert-action@v1
114+
- uses: nick-fields/assert-action@v2
115115
with:
116116
expected: failure
117117
actual: ${{ steps.retry_on_error.outcome }}
118-
- uses: nick-fields/assert-action@v1
118+
- uses: nick-fields/assert-action@v2
119119
with:
120120
expected: 2
121121
actual: ${{ steps.retry_on_error.outputs.exit_code }}
@@ -129,11 +129,11 @@ jobs:
129129
max_attempts: 2
130130
shell: cmd
131131
command: 'dir'
132-
- uses: nick-fields/assert-action@v1
132+
- uses: nick-fields/assert-action@v2
133133
with:
134134
expected: 2
135135
actual: ${{ steps.wrong_shell.outputs.total_attempts }}
136-
- uses: nick-fields/assert-action@v1
136+
- uses: nick-fields/assert-action@v2
137137
with:
138138
expected: failure
139139
actual: ${{ steps.wrong_shell.outcome }}
@@ -180,12 +180,12 @@ jobs:
180180
timeout_minutes: 5
181181
command: 'make -C ./test-data/large-output bytes-102400'
182182
- name: Assert test had expected result
183-
uses: nick-fields/assert-action@v1
183+
uses: nick-fields/assert-action@v2
184184
with:
185185
expected: failure
186186
actual: ${{ steps.large-output.outcome }}
187187
- name: Assert exit code is expected
188-
uses: nick-fields/assert-action@v1
188+
uses: nick-fields/assert-action@v2
189189
with:
190190
expected: 2
191191
actual: ${{ steps.large-output.outputs.exit_code }}
@@ -211,11 +211,11 @@ jobs:
211211
retry_on_exit_code: 2
212212
max_attempts: 3
213213
command: node -e "process.exit(2)"
214-
- uses: nick-fields/assert-action@v1
214+
- uses: nick-fields/assert-action@v2
215215
with:
216216
expected: failure
217217
actual: ${{ steps.retry_on_exit_code_expected.outcome }}
218-
- uses: nick-fields/assert-action@v1
218+
- uses: nick-fields/assert-action@v2
219219
with:
220220
expected: 3
221221
actual: ${{ steps.retry_on_exit_code_expected.outputs.total_attempts }}
@@ -229,11 +229,11 @@ jobs:
229229
retry_on_exit_code: 2
230230
max_attempts: 3
231231
command: node -e "process.exit(1)"
232-
- uses: nick-fields/assert-action@v1
232+
- uses: nick-fields/assert-action@v2
233233
with:
234234
expected: failure
235235
actual: ${{ steps.retry_on_exit_code_unexpected.outcome }}
236-
- uses: nick-fields/assert-action@v1
236+
- uses: nick-fields/assert-action@v2
237237
with:
238238
expected: 1
239239
actual: ${{ steps.retry_on_exit_code_unexpected.outputs.total_attempts }}
@@ -265,22 +265,22 @@ jobs:
265265
timeout_minutes: 1
266266
continue_on_error: true
267267
- name: Verify continue_on_error returns correct exit code on success
268-
uses: nick-fields/assert-action@v1
268+
uses: nick-fields/assert-action@v2
269269
with:
270270
expected: 0
271271
actual: ${{ steps.happy_path_continue_on_error.outputs.exit_code }}
272272
- name: Verify continue_on_error exits with correct outcome on success
273-
uses: nick-fields/assert-action@v1
273+
uses: nick-fields/assert-action@v2
274274
with:
275275
expected: success
276276
actual: ${{ steps.happy_path_continue_on_error.outcome }}
277277
- name: Verify continue_on_error returns correct exit code on error
278-
uses: nick-fields/assert-action@v1
278+
uses: nick-fields/assert-action@v2
279279
with:
280280
expected: 33
281281
actual: ${{ steps.sad_path_continue_on_error.outputs.exit_code }}
282282
- name: Verify continue_on_error exits with successful outcome when an error occurs
283-
uses: nick-fields/assert-action@v1
283+
uses: nick-fields/assert-action@v2
284284
with:
285285
expected: success
286286
actual: ${{ steps.sad_path_continue_on_error.outcome }}
@@ -307,15 +307,15 @@ jobs:
307307
max_attempts: 3
308308
retry_wait_seconds: 15
309309
command: npm install this-isnt-a-real-package-name-zzz
310-
- uses: nick-fields/assert-action@v1
310+
- uses: nick-fields/assert-action@v2
311311
with:
312312
expected: 3
313313
actual: ${{ steps.sad_path_wait_sec.outputs.total_attempts }}
314-
- uses: nick-fields/assert-action@v1
314+
- uses: nick-fields/assert-action@v2
315315
with:
316316
expected: failure
317317
actual: ${{ steps.sad_path_wait_sec.outcome }}
318-
- uses: nick-fields/assert-action@v1
318+
- uses: nick-fields/assert-action@v2
319319
with:
320320
expected: 'Final attempt failed'
321321
actual: ${{ steps.sad_path_wait_sec.outputs.exit_error }}
@@ -385,11 +385,11 @@ jobs:
385385
timeout_seconds: 15
386386
max_attempts: 2
387387
command: node -e "(async()=>await new Promise(r => setTimeout(r, 120000)))()"
388-
- uses: nick-fields/assert-action@v1
388+
- uses: nick-fields/assert-action@v2
389389
with:
390390
expected: 2
391391
actual: ${{ steps.sad_path_timeout.outputs.total_attempts }}
392-
- uses: nick-fields/assert-action@v1
392+
- uses: nick-fields/assert-action@v2
393393
with:
394394
expected: failure
395395
actual: ${{ steps.sad_path_timeout.outcome }}
@@ -416,11 +416,11 @@ jobs:
416416
max_attempts: 2
417417
retry_on: timeout
418418
command: node -e "(async()=>await new Promise(r => setTimeout(r, 120000)))()"
419-
- uses: nick-fields/assert-action@v1
419+
- uses: nick-fields/assert-action@v2
420420
with:
421421
expected: 2
422422
actual: ${{ steps.retry_on_timeout.outputs.total_attempts }}
423-
- uses: nick-fields/assert-action@v1
423+
- uses: nick-fields/assert-action@v2
424424
with:
425425
expected: failure
426426
actual: ${{ steps.retry_on_timeout.outcome }}
@@ -447,15 +447,15 @@ jobs:
447447
max_attempts: 2
448448
retry_on: error
449449
command: node -e "(async()=>await new Promise(r => setTimeout(r, 120000)))()"
450-
- uses: nick-fields/assert-action@v1
450+
- uses: nick-fields/assert-action@v2
451451
with:
452452
expected: 1
453453
actual: ${{ steps.retry_on_error_fail.outputs.total_attempts }}
454-
- uses: nick-fields/assert-action@v1
454+
- uses: nick-fields/assert-action@v2
455455
with:
456456
expected: failure
457457
actual: ${{ steps.retry_on_error_fail.outcome }}
458-
- uses: nick-fields/assert-action@v1
458+
- uses: nick-fields/assert-action@v2
459459
with:
460460
expected: 1
461461
actual: ${{ steps.retry_on_error_fail.outputs.exit_code }}
@@ -481,11 +481,11 @@ jobs:
481481
timeout_minutes: 1
482482
max_attempts: 2
483483
command: node -e "(async()=>await new Promise(r => setTimeout(r, 120000)))()"
484-
- uses: nick-fields/assert-action@v1
484+
- uses: nick-fields/assert-action@v2
485485
with:
486486
expected: 2
487487
actual: ${{ steps.sad_path_timeout_minutes.outputs.total_attempts }}
488-
- uses: nick-fields/assert-action@v1
488+
- uses: nick-fields/assert-action@v2
489489
with:
490490
expected: failure
491491
actual: ${{ steps.sad_path_timeout_minutes.outcome }}
@@ -584,6 +584,8 @@ jobs:
584584
env:
585585
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
586586
- name: Tag
587+
# only bump v# (e.g., v3) tag if semantic release action publishes any new version
588+
if: ${{ steps.semantic.outputs.new_release_major_version != '' }}
587589
run: git tag -f v${MAJOR_VERSION} && git push -f origin v${MAJOR_VERSION}
588590
env:
589591
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

dist/index.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25040,17 +25040,18 @@ function runAction(inputs) {
2504025040
attempt = 1;
2504125041
_a.label = 2;
2504225042
case 2:
25043-
if (!(attempt <= inputs.max_attempts)) return [3 /*break*/, 13];
25043+
if (!(attempt <= inputs.max_attempts)) return [3 /*break*/, 14];
25044+
(0, core_1.info)("::group::Attempt ".concat(attempt));
2504425045
_a.label = 3;
2504525046
case 3:
25046-
_a.trys.push([3, 5, , 12]);
25047+
_a.trys.push([3, 5, 12, 13]);
2504725048
// just keep overwriting attempts output
2504825049
(0, core_1.setOutput)(OUTPUT_TOTAL_ATTEMPTS_KEY, attempt);
2504925050
return [4 /*yield*/, runCmd(attempt, inputs)];
2505025051
case 4:
2505125052
_a.sent();
2505225053
(0, core_1.info)("Command completed after ".concat(attempt, " attempt(s)."));
25053-
return [3 /*break*/, 13];
25054+
return [3 /*break*/, 14];
2505425055
case 5:
2505525056
error_2 = _a.sent();
2505625057
if (!(attempt === inputs.max_attempts)) return [3 /*break*/, 6];
@@ -25076,11 +25077,14 @@ function runAction(inputs) {
2507625077
(0, core_1.info)("Attempt ".concat(attempt, " failed. Reason: ").concat(error_2.message));
2507725078
}
2507825079
_a.label = 11;
25079-
case 11: return [3 /*break*/, 12];
25080+
case 11: return [3 /*break*/, 13];
2508025081
case 12:
25082+
(0, core_1.info)("::endgroup::");
25083+
return [7 /*endfinally*/];
25084+
case 13:
2508125085
attempt++;
2508225086
return [3 /*break*/, 2];
25083-
case 13: return [2 /*return*/];
25087+
case 14: return [2 /*return*/];
2508425088
}
2508525089
});
2508625090
});

0 commit comments

Comments
 (0)