@@ -13,33 +13,39 @@ async function main(): Promise<void> {
1313 const config = getConfig ( ) ;
1414 api . init ( config ) ;
1515
16- const activeJobUrl = await api . fetchWorkflowRunActiveJobUrlRetry (
16+ const activeJobUrlResult = await api . fetchWorkflowRunActiveJobUrlRetry (
1717 config . runId ,
1818 constants . WORKFLOW_RUN_ACTIVE_JOB_TIMEOUT_MS ,
1919 ) ;
20+ if ( ! activeJobUrlResult . success ) {
21+ const elapsedTime = Date . now ( ) - startTime ;
22+ const failureMsg = `Timeout exceeded while attempting to find the active job run URL (${ elapsedTime } ms)` ;
23+ await handleActionFail ( failureMsg , config . runId ) ;
24+ return ;
25+ }
2026 core . info (
2127 `Awaiting completion of Workflow Run ${ config . runId } ...\n` +
2228 ` ID: ${ config . runId } \n` +
23- ` URL: ${ activeJobUrl } ` ,
29+ ` URL: ${ activeJobUrlResult . value } ` ,
2430 ) ;
2531
26- const result = await getWorkflowRunResult ( {
32+ const runResult = await getWorkflowRunResult ( {
2733 startTime,
2834 pollIntervalMs : config . pollIntervalMs ,
2935 runId : config . runId ,
3036 runTimeoutMs : config . runTimeoutSeconds * 1000 ,
3137 } ) ;
32- if ( ! result . success ) {
38+ if ( ! runResult . success ) {
3339 const elapsedTime = Date . now ( ) - startTime ;
3440 const failureMsg =
35- result . reason === "timeout"
41+ runResult . reason === "timeout"
3642 ? `Timeout exceeded while attempting to await run conclusion (${ elapsedTime } ms)`
37- : `An unsupported value was reached: ${ result . value } ` ;
43+ : `An unsupported value was reached: ${ runResult . value } ` ;
3844 await handleActionFail ( failureMsg , config . runId ) ;
3945 return ;
4046 }
4147
42- const { status, conclusion } = result . value ;
48+ const { status, conclusion } = runResult . value ;
4349 if ( conclusion === WorkflowRunConclusion . Success ) {
4450 core . info (
4551 "Run Completed:\n" +
0 commit comments