Tag to head, before I try something else.

This commit is contained in:
Michael J Mulligan 2021-04-07 13:34:24 +01:00
parent 34b867b38a
commit 984bec9da3
3 changed files with 9 additions and 12 deletions

View file

@ -6840,7 +6840,8 @@ function resolveCheckRunId() {
const ctx = github.context; const ctx = github.context;
if (process.env.GITHUB_ACTIONS === `true` && ctx.runId) { if (process.env.GITHUB_ACTIONS === `true` && ctx.runId) {
try { 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 })); const octokit = github.getOctokit(core.getInput(`github-token`, { required: true }));
let workflowJobs = (yield octokit.actions let workflowJobs = (yield octokit.actions
.listJobsForWorkflowRun(Object.assign(Object.assign({}, ctx.repo), { run_id: ctx.runId })) .listJobsForWorkflowRun(Object.assign(Object.assign({}, ctx.repo), { run_id: ctx.runId }))
@ -6856,12 +6857,10 @@ function resolveCheckRunId() {
workflowJobs = jobs.length ? jobs : workflowJobs; workflowJobs = jobs.length ? jobs : workflowJobs;
} }
if (workflowJobs.length > 1) { if (workflowJobs.length > 1) {
const searchToken = uuid_1.v4();
core.info(`::warning::[ignore] Resolving GitHub Job with Search Token: ${searchToken}`);
const startedAt = Date.now(); const startedAt = Date.now();
// Sleep for MS, to allow Annotation to be captured and populated // Sleep for MS, to allow Annotation to be captured and populated
yield ((ms) => new Promise((resolve) => setTimeout(resolve, ms)))(10 * 1000); 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) { for (const job of workflowJobs) {
try { try {
const { data: annotations } = yield octokit.checks.listAnnotations(Object.assign(Object.assign({}, ctx.repo), { check_run_id: job.id })); const { data: annotations } = yield octokit.checks.listAnnotations(Object.assign(Object.assign({}, ctx.repo), { check_run_id: job.id }));

7
dist/run/index.js vendored
View file

@ -6850,7 +6850,8 @@ function resolveCheckRunId() {
const ctx = github.context; const ctx = github.context;
if (process.env.GITHUB_ACTIONS === `true` && ctx.runId) { if (process.env.GITHUB_ACTIONS === `true` && ctx.runId) {
try { 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 })); const octokit = github.getOctokit(core.getInput(`github-token`, { required: true }));
let workflowJobs = (yield octokit.actions let workflowJobs = (yield octokit.actions
.listJobsForWorkflowRun(Object.assign(Object.assign({}, ctx.repo), { run_id: ctx.runId })) .listJobsForWorkflowRun(Object.assign(Object.assign({}, ctx.repo), { run_id: ctx.runId }))
@ -6866,12 +6867,10 @@ function resolveCheckRunId() {
workflowJobs = jobs.length ? jobs : workflowJobs; workflowJobs = jobs.length ? jobs : workflowJobs;
} }
if (workflowJobs.length > 1) { if (workflowJobs.length > 1) {
const searchToken = uuid_1.v4();
core.info(`::warning::[ignore] Resolving GitHub Job with Search Token: ${searchToken}`);
const startedAt = Date.now(); const startedAt = Date.now();
// Sleep for MS, to allow Annotation to be captured and populated // Sleep for MS, to allow Annotation to be captured and populated
yield ((ms) => new Promise((resolve) => setTimeout(resolve, ms)))(10 * 1000); 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) { for (const job of workflowJobs) {
try { try {
const { data: annotations } = yield octokit.checks.listAnnotations(Object.assign(Object.assign({}, ctx.repo), { check_run_id: job.id })); const { data: annotations } = yield octokit.checks.listAnnotations(Object.assign(Object.assign({}, ctx.repo), { check_run_id: job.id }));

View file

@ -245,7 +245,8 @@ async function resolveCheckRunId(): Promise<number> {
if (process.env.GITHUB_ACTIONS === `true` && ctx.runId) { if (process.env.GITHUB_ACTIONS === `true` && ctx.runId) {
try { 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 })) const octokit = github.getOctokit(core.getInput(`github-token`, { required: true }))
let workflowJobs = ( let workflowJobs = (
await octokit.actions await octokit.actions
@ -267,12 +268,10 @@ async function resolveCheckRunId(): Promise<number> {
workflowJobs = jobs.length ? jobs : workflowJobs workflowJobs = jobs.length ? jobs : workflowJobs
} }
if (workflowJobs.length > 1) { if (workflowJobs.length > 1) {
const searchToken = uuidv4()
core.info(`::warning::[ignore] Resolving GitHub Job with Search Token: ${searchToken}`)
const startedAt = Date.now() const startedAt = Date.now()
// Sleep for MS, to allow Annotation to be captured and populated // Sleep for MS, to allow Annotation to be captured and populated
await ((ms): Promise<void> => new Promise((resolve) => setTimeout(resolve, ms)))(10 * 1000) await ((ms): Promise<void> => 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) { for (const job of workflowJobs) {
try { try {
const { data: annotations } = await octokit.checks.listAnnotations({ const { data: annotations } = await octokit.checks.listAnnotations({