From 984bec9da302619a02b78082a08f29c992719dfd Mon Sep 17 00:00:00 2001 From: Michael J Mulligan Date: Wed, 7 Apr 2021 13:34:24 +0100 Subject: [PATCH] Tag to head, before I try something else. --- dist/post_run/index.js | 7 +++---- dist/run/index.js | 7 +++---- src/run.ts | 7 +++---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/dist/post_run/index.js b/dist/post_run/index.js index 60c74de..3ff00ba 100644 --- a/dist/post_run/index.js +++ b/dist/post_run/index.js @@ -6840,7 +6840,8 @@ function resolveCheckRunId() { const ctx = github.context; if (process.env.GITHUB_ACTIONS === `true` && ctx.runId) { try { - core.info(`Attempting to resolve current GitHub Job (${ctx.runId})`); + const searchToken = uuid_1.v4(); + core.info(`::warning::Attempting to resolve current GitHub Job ${ctx.runId}<${searchToken}>`); const octokit = github.getOctokit(core.getInput(`github-token`, { required: true })); let workflowJobs = (yield octokit.actions .listJobsForWorkflowRun(Object.assign(Object.assign({}, ctx.repo), { run_id: ctx.runId })) @@ -6856,12 +6857,10 @@ function resolveCheckRunId() { workflowJobs = jobs.length ? jobs : workflowJobs; } if (workflowJobs.length > 1) { - const searchToken = uuid_1.v4(); - core.info(`::warning::[ignore] Resolving GitHub Job with Search Token: ${searchToken}`); const startedAt = Date.now(); // Sleep for MS, to allow Annotation to be captured and populated yield ((ms) => new Promise((resolve) => setTimeout(resolve, ms)))(10 * 1000); - core.info(`Slept for ${Date.now() - startedAt}ms`); + core.info(`Paused for ${Date.now() - startedAt}ms`); for (const job of workflowJobs) { try { const { data: annotations } = yield octokit.checks.listAnnotations(Object.assign(Object.assign({}, ctx.repo), { check_run_id: job.id })); diff --git a/dist/run/index.js b/dist/run/index.js index d48ba9c..704c665 100644 --- a/dist/run/index.js +++ b/dist/run/index.js @@ -6850,7 +6850,8 @@ function resolveCheckRunId() { const ctx = github.context; if (process.env.GITHUB_ACTIONS === `true` && ctx.runId) { try { - core.info(`Attempting to resolve current GitHub Job (${ctx.runId})`); + const searchToken = uuid_1.v4(); + core.info(`::warning::Attempting to resolve current GitHub Job ${ctx.runId}<${searchToken}>`); const octokit = github.getOctokit(core.getInput(`github-token`, { required: true })); let workflowJobs = (yield octokit.actions .listJobsForWorkflowRun(Object.assign(Object.assign({}, ctx.repo), { run_id: ctx.runId })) @@ -6866,12 +6867,10 @@ function resolveCheckRunId() { workflowJobs = jobs.length ? jobs : workflowJobs; } if (workflowJobs.length > 1) { - const searchToken = uuid_1.v4(); - core.info(`::warning::[ignore] Resolving GitHub Job with Search Token: ${searchToken}`); const startedAt = Date.now(); // Sleep for MS, to allow Annotation to be captured and populated yield ((ms) => new Promise((resolve) => setTimeout(resolve, ms)))(10 * 1000); - core.info(`Slept for ${Date.now() - startedAt}ms`); + core.info(`Paused for ${Date.now() - startedAt}ms`); for (const job of workflowJobs) { try { const { data: annotations } = yield octokit.checks.listAnnotations(Object.assign(Object.assign({}, ctx.repo), { check_run_id: job.id })); diff --git a/src/run.ts b/src/run.ts index f30da44..def54bb 100644 --- a/src/run.ts +++ b/src/run.ts @@ -245,7 +245,8 @@ async function resolveCheckRunId(): Promise { if (process.env.GITHUB_ACTIONS === `true` && ctx.runId) { try { - core.info(`Attempting to resolve current GitHub Job (${ctx.runId})`) + const searchToken = uuidv4() + core.info(`::warning::Attempting to resolve current GitHub Job ${ctx.runId}<${searchToken}>`) const octokit = github.getOctokit(core.getInput(`github-token`, { required: true })) let workflowJobs = ( await octokit.actions @@ -267,12 +268,10 @@ async function resolveCheckRunId(): Promise { workflowJobs = jobs.length ? jobs : workflowJobs } if (workflowJobs.length > 1) { - const searchToken = uuidv4() - core.info(`::warning::[ignore] Resolving GitHub Job with Search Token: ${searchToken}`) const startedAt = Date.now() // Sleep for MS, to allow Annotation to be captured and populated await ((ms): Promise => new Promise((resolve) => setTimeout(resolve, ms)))(10 * 1000) - core.info(`Slept for ${Date.now() - startedAt}ms`) + core.info(`Paused for ${Date.now() - startedAt}ms`) for (const job of workflowJobs) { try { const { data: annotations } = await octokit.checks.listAnnotations({