INNER CODE UNIT · TypeScript
run
cloudposse/atmos · .github/actions/stopwatch/src/index.ts:141
async function run(): Promise<void> {
await setResult(false, "Action has not completed");
const token = getInput("github-token");
const workflowRunId = parseIntegerInput("workflow-run-id", 1);
const settleSeconds = parseIntegerInput("settle-seconds", 0, 120);
const marker = getInput("comment-marker");
const commentAuthor = getInput("comment-author");
const repository = process.env.GITHUB_REPOSITORY?.split("/");
if (repository?.length !== 2 || repository[0] === "" || repository[1] === "") {
throw new Error("GITHUB_REPOSITORY must contain owner/repository");
}
const [owner, repo] = repository;
const encodedRepo = `/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}`;
const client = new GitHubClient(token);
if (settleSeconds > 0) {
console.log(`Waiting ${settleSeconds}s for sibling workflow runs to be indexed`);