Clean up url resolution

This commit is contained in:
Colin McDonnell
2026-02-13 14:24:46 +00:00
committed by pullfrog[bot]
parent 267a4586ae
commit 78cf05f111
13 changed files with 211 additions and 146 deletions
+16
View File
@@ -1,8 +1,21 @@
import { performance } from "node:perf_hooks";
import * as core from "@actions/core";
export const DEFAULT_ACTIVITY_TIMEOUT_MS = 60_000;
export const DEFAULT_ACTIVITY_CHECK_INTERVAL_MS = 5_000;
// inline debug check — can't import log.ts since activity.ts is a dependency of it
function debugLog(msg: string): void {
const isDebug =
process.env.LOG_LEVEL === "debug" ||
process.env.ACTIONS_STEP_DEBUG === "true" ||
process.env.RUNNER_DEBUG === "1" ||
core.isDebug();
if (isDebug) {
core.info(`[${new Date().toISOString()}] [DEBUG] ${msg}`);
}
}
type ActivityTimeoutContext = {
timeoutMs: number;
checkIntervalMs: number;
@@ -72,8 +85,11 @@ function startProcessOutputMonitor(ctx: OutputMonitorContext): OutputMonitor {
process.stdout.write = wrapWrite(originalStdoutWrite, markActivity);
process.stderr.write = wrapWrite(originalStderrWrite, markActivity);
debugLog(`process activity monitor started: timeout=${ctx.timeoutMs}ms`);
const intervalId = setInterval(() => {
const idleMs = getIdleMs();
debugLog(`process activity check: idle=${idleMs}ms / ${ctx.timeoutMs}ms`);
if (timedOut || idleMs <= ctx.timeoutMs) return;
timedOut = true;
ctx.onTimeout(idleMs);