INNER CODE UNIT · TypeScript
incompleteJobs
cloudposse/atmos · .github/actions/stopwatch/src/index.ts:226
const incompleteJobs = [...jobsByRun.values()].flat().filter((jobData) => jobData.status !== "completed");
if (incompleteJobs.length > 0) {
const reason = `Waiting for ${incompleteJobs.length} job(s): ${incompleteJobs.map((jobData) => jobData.name).join(", ")}`;
console.log(reason);
await setResult(false, reason);
return;
}
// Re-check immediately before writing so an older coordinator cannot replace
// the sticky comment after the PR receives a newer commit.
const currentPullRequest = await client.request<ApiPullRequest>("GET", pullRequestPath);
if (currentPullRequest.state !== "open" || currentPullRequest.head.sha !== headSha) {
const reason = `PR #${pullRequestNumber} changed while timings were being calculated`;
console.log(reason);
await setResult(false, reason);
return;
}