Skip to content

Commit

Permalink
Remove unused code and compile
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Jun 5, 2024
1 parent 5a273f5 commit b5b8e70
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
20 changes: 15 additions & 5 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31107,8 +31107,11 @@ var Options = z2.object({
path: ["initialDuration", "waitList"]
}
);
var Path = z2.string().min(1);

// src/input.ts
import { mkdtempSync } from "fs";
import { join } from "path";
function parseInput() {
const {
repo,
Expand All @@ -31128,6 +31131,8 @@ function parseInput() {
(0, import_core.error)("github context has unexpected format: missing context.payload.pull_request.head.sha");
}
}
const tempRoot = Path.parse(process.env["RUNNER_TEMP"]);
const tempDir = mkdtempSync(join(tempRoot, "wait-other-jobs-"));
const waitSecondsBeforeFirstPolling = parseInt(
(0, import_core.getInput)("wait-seconds-before-first-polling", { required: true, trimWhitespace: true }),
10
Expand Down Expand Up @@ -31158,7 +31163,7 @@ function parseInput() {
const trigger = { ...repo, ref: commitSha, runId, jobName: job, eventName };
const githubToken = (0, import_core.getInput)("github-token", { required: true, trimWhitespace: false });
(0, import_core.setSecret)(githubToken);
return { trigger, options, githubToken };
return { trigger, options, githubToken, tempDir };
}

// node_modules/.pnpm/universal-user-agent@7.0.2/node_modules/universal-user-agent/index.js
Expand Down Expand Up @@ -32343,7 +32348,7 @@ async function fetchChecks(token, trigger) {
}

// src/report.ts
import { join, relative } from "path";
import { join as join2, relative } from "path";

// src/util.ts
function groupBy(items, callback) {
Expand Down Expand Up @@ -32397,7 +32402,7 @@ function summarize(check, trigger) {
}
function getSummaries(checks, trigger) {
return checks.map((check) => summarize(check, trigger)).toSorted(
(a2, b2) => join(a2.workflowBasename, a2.jobName).localeCompare(join(b2.workflowBasename, b2.jobName))
(a2, b2) => join2(a2.workflowBasename, a2.jobName).localeCompare(join2(b2.workflowBasename, b2.jobName))
);
}
function seekWaitList(summaries, waitList, elapsed) {
Expand Down Expand Up @@ -32529,6 +32534,8 @@ function getInterval(method, leastInterval, attempts) {
}

// src/main.ts
import { join as join3 } from "path";
import { writeFileSync } from "fs";
function colorize(severity, message) {
switch (severity) {
case "error": {
Expand All @@ -32552,7 +32559,7 @@ function colorize(severity, message) {
async function run() {
const startedAt = performance.now();
(0, import_core3.startGroup)("Parameters");
const { trigger, options, githubToken } = parseInput();
const { trigger, options, githubToken, tempDir } = parseInput();
(0, import_core3.info)(JSON.stringify(
// Do NOT include payload
{
Expand All @@ -32571,6 +32578,7 @@ async function run() {
return;
}
const dumper = { trigger, options, results: {} };
const dumpFile = join3(tempDir, "dump.json");
for (; ; ) {
attempts += 1;
if (attempts > options.attemptLimits) {
Expand Down Expand Up @@ -32644,7 +32652,9 @@ async function run() {
break;
}
}
(0, import_core3.setOutput)("dump", JSON.stringify(dumper, null, 2));
writeFileSync(dumpFile, JSON.stringify(dumper, null, 2));
(0, import_core3.setOutput)("dump", dumpFile);
(0, import_core3.info)(colorize("info", `you can read the checks detail in ${dumpFile}`));
}
void run();
/*! Bundled license information:
Expand Down
1 change: 0 additions & 1 deletion src/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { context } from '@actions/github';
import { Durationable, Options, Path, Trigger } from './schema.ts';
import { mkdtempSync } from 'fs';
import { join } from 'path';
import { assert } from 'console';

export function parseInput(): { trigger: Trigger; options: Options; githubToken: string; tempDir: string } {
const {
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { getInterval, wait } from './wait.ts';
import { Temporal } from 'temporal-polyfill';
import { Check, Options, Trigger } from './schema.ts';
import { join } from 'path';
import { fstat, writeFileSync } from 'fs';
import { writeFileSync } from 'fs';

interface Result {
elapsed: Temporal.Duration;
Expand Down

0 comments on commit b5b8e70

Please sign in to comment.