INNER CODE UNIT · TypeScript

setOutput

cloudposse/atmos · .github/actions/stopwatch/src/index.ts:74

async function setOutput(name: string, value: string | number | boolean): Promise<void> {
  const outputFile = process.env.GITHUB_OUTPUT;
  if (outputFile === undefined || outputFile === "") {
    console.log(`${name}=${value}`);
    return;
  }

  const delimiter = `ghadelimiter_${randomUUID()}`;
  await appendFile(outputFile, `${name}<<${delimiter}\n${value}\n${delimiter}\n`, "utf8");
}

/** Records whether the action published a timing summary and why. */
async function setResult(published: boolean, reason: string): Promise<void> {
  await setOutput("published", published);
  await setOutput("reason", reason);
}

/** Converts a GitHub workflow-run response to the metrics model. */

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…