diff --git a/lib/init-action-post.js b/lib/init-action-post.js index f06bc514a..aa88e1627 100644 --- a/lib/init-action-post.js +++ b/lib/init-action-post.js @@ -132921,6 +132921,7 @@ async function testCancellationDetection() { ); return; } + await new Promise((resolve8) => setTimeout(resolve8, 15e3)); const checkRunId = parseInt(checkRunIdInput, 10); logger.info( `[Cancellation Test] Querying jobs API for run ${runId}, attempt ${attemptNumber}, check_run_id ${checkRunId}` @@ -132971,8 +132972,8 @@ async function run2(startedAt) { let uploadFailedSarifResult; let dependencyCachingUsage; try { - await testCancellationDetection(); restoreInputs(); + await testCancellationDetection(); const gitHubVersion = await getGitHubVersion(); checkGitHubVersionInRange(gitHubVersion, logger); const repositoryNwo = getRepositoryNwo(); diff --git a/src/init-action-post.ts b/src/init-action-post.ts index d6b81aef3..cd7401e19 100644 --- a/src/init-action-post.ts +++ b/src/init-action-post.ts @@ -64,6 +64,9 @@ async function testCancellationDetection(): Promise { return; } + // Wait 15 seconds to ensure that the API has caught up with the job status + await new Promise((resolve) => setTimeout(resolve, 15000)); + const checkRunId = parseInt(checkRunIdInput, 10); logger.info( `[Cancellation Test] Querying jobs API for run ${runId}, attempt ${attemptNumber}, check_run_id ${checkRunId}`, @@ -127,12 +130,12 @@ async function run(startedAt: Date) { | undefined; let dependencyCachingUsage: DependencyCachingUsageReport | undefined; try { - // TEMPORARY: Test cancellation detection via API - await testCancellationDetection(); - // Restore inputs from `init` Action. restoreInputs(); + // TEMPORARY: Test cancellation detection via API + await testCancellationDetection(); + const gitHubVersion = await getGitHubVersion(); checkGitHubVersionInRange(gitHubVersion, logger);