Skip to content

Commit 3cb9ce4

Browse files
committed
feat: add RETRY_ATTEMPT environment variable
1 parent 9417ab4 commit 3cb9ce4

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

dist/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25042,6 +25042,7 @@ function runAction(inputs) {
2504225042
case 2:
2504325043
if (!(attempt <= inputs.max_attempts)) return [3 /*break*/, 14];
2504425044
(0, core_1.info)("::group::Attempt ".concat(attempt));
25045+
(0, core_1.exportVariable)('RETRY_ATTEMPT', "".concat(attempt));
2504525046
_a.label = 3;
2504625047
case 3:
2504725048
_a.trys.push([3, 5, 12, 13]);

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { error, warning, info, debug, setOutput } from '@actions/core';
1+
import { error, warning, info, debug, setOutput, exportVariable } from '@actions/core';
22
import { execSync, spawn } from 'child_process';
33
import ms from 'milliseconds';
44
import kill from 'tree-kill';
@@ -131,6 +131,7 @@ async function runAction(inputs: Inputs) {
131131

132132
for (let attempt = 1; attempt <= inputs.max_attempts; attempt++) {
133133
info(`::group::Attempt ${attempt}`);
134+
exportVariable('RETRY_ATTEMPT', `${attempt}`);
134135
try {
135136
// just keep overwriting attempts output
136137
setOutput(OUTPUT_TOTAL_ATTEMPTS_KEY, attempt);

0 commit comments

Comments
 (0)