Skip to content

Commit 83057f1

Browse files
committed
fix: action would make extraneous calls when no run ids were found
1 parent d15ca0b commit 83057f1

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

src/return-dispatch.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,23 @@ export async function getRunIdAndUrl({
167167
}
168168

169169
const workflowRunIds = fetchWorkflowRunIds.value;
170-
core.debug(
171-
`Attempting to get step names for Run IDs: [${workflowRunIds.join(", ")}]`,
172-
);
173170

174-
const result = await attemptToFindRunId(distinctIdRegex, workflowRunIds);
175-
if (result.success) {
176-
return result;
177-
}
171+
if (workflowRunIds.length > 0) {
172+
core.debug(
173+
`Attempting to get step names for Run IDs: [${workflowRunIds.join(", ")}]`,
174+
);
178175

179-
core.info(`Exhausted searching IDs in known runs, attempt ${attemptNo}...`);
176+
const result = await attemptToFindRunId(distinctIdRegex, workflowRunIds);
177+
if (result.success) {
178+
return result;
179+
}
180+
181+
core.info(
182+
`Exhausted searching IDs in known runs, attempt ${attemptNo}...`,
183+
);
184+
} else {
185+
core.info(`No Run IDs found for workflow, attempt ${attemptNo}...`);
186+
}
180187

181188
await sleep(constants.WORKFLOW_JOB_STEPS_RETRY_MS);
182189
}

0 commit comments

Comments
 (0)