Skip to content

Commit

Permalink
added k8s-mode detection capability
Browse files Browse the repository at this point in the history
  • Loading branch information
h0x0er committed Oct 3, 2023
1 parent d7f96b7 commit 5e33d2d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/arc-runner.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
import * as cp from "child_process";
import * as fs from "fs";
import { sleep } from "./setup";

export function isArcRunner(): boolean {
const runnerUserAgent = process.env["GITHUB_ACTIONS_RUNNER_EXTRA_USER_AGENT"];

let isARC = false;

if (!runnerUserAgent) {
return false;
isARC = false;
} else {
isARC = runnerUserAgent.includes("actions-runner-controller/");
}

return runnerUserAgent.includes("actions-runner-controller/");
return isARC || isSecondaryPod();
}

function isSecondaryPod(): boolean {
const workDir = "/__w";
return fs.existsSync(workDir);
}

function getRunnerTempDir(): string {
Expand Down

0 comments on commit 5e33d2d

Please sign in to comment.