diff --git a/gh_action/dist/main/index.js b/gh_action/dist/main/index.js index 9e1fe1f3..9f06da86 100644 --- a/gh_action/dist/main/index.js +++ b/gh_action/dist/main/index.js @@ -81051,7 +81051,6 @@ const tc = __importStar(__nccwpck_require__(5561)); const cache = __importStar(__nccwpck_require__(7877)); const exec = __importStar(__nccwpck_require__(7775)); const path = __importStar(__nccwpck_require__(1017)); -const util = __importStar(__nccwpck_require__(3837)); const os = __importStar(__nccwpck_require__(2037)); const crypto_1 = __importDefault(__nccwpck_require__(6113)); // TODO: auto-manage this version @@ -81117,9 +81116,11 @@ async function run() { const key = `${keyPrefix}-${hash}`; const envsDir = core.toPlatformPath(path.resolve(ghjkDir, "envs")); const cacheDirs = [envsDir]; - await cache.restoreCache(cacheDirs, key); + core.info(JSON.stringify({ cacheDirs, envsDir, ghjkDir })); + // NOTE: restoreCache modifies the array it's given for some reason + await cache.restoreCache([...cacheDirs], key); if (inputCacheSaveIf == "true") { - core.info(`enabling cache with key ${key}`); + core.info(`enabling cache with key ${key}: [${cacheDirs}]`); core.saveState("ghjk-cache-save", true); core.saveState("ghjk-post-args", { key, @@ -81162,7 +81163,7 @@ async function installGhjk(version, installerUrl, skipDenoInstall) { core.debug(`unable to find cached ghjk tool under version ${version}`); } } - core.debug(`installing ghjk using install.sh`); + core.debug(`installing ghjk using install.ts`); const installDir = process.env["GHJK_INSTALL_EXE_DIR"] ?? core.toPlatformPath(path.resolve(os.homedir(), ".local", "bin")); const env = { @@ -81174,7 +81175,7 @@ async function installGhjk(version, installerUrl, skipDenoInstall) { // to avoid it hardcoding the current deno bin path // which won't be the same after tool cache restore env["GHJK_INSTALL_DENO_EXEC"] = "deno"; - core.debug(util.inspect({ denoExec, env }, false, undefined, false)); + core.debug(JSON.stringify({ denoExec, env }, undefined, " ")); await exec.exec(`"${denoExec}" run -A`, [installerUrl], { env }); if (version) { return await tc.cacheDir(installDir, "ghjk", version); diff --git a/gh_action/main.ts b/gh_action/main.ts index f3a77e07..d095503b 100644 --- a/gh_action/main.ts +++ b/gh_action/main.ts @@ -3,10 +3,8 @@ import * as tc from "@actions/tool-cache"; import * as cache from "@actions/cache"; import * as exec from "@actions/exec"; import * as path from "path"; -import * as util from "util"; import * as os from "os"; import crypto from "crypto"; -import { info } from "console"; // TODO: auto-manage this version const DENO_VERSION = "1.38.5"; @@ -94,9 +92,11 @@ async function run(): Promise { const envsDir = core.toPlatformPath(path.resolve(ghjkDir, "envs")); const cacheDirs = [envsDir]; - await cache.restoreCache(cacheDirs, key); + core.info(JSON.stringify({ cacheDirs, envsDir, ghjkDir })); + // NOTE: restoreCache modifies the array it's given for some reason + await cache.restoreCache([...cacheDirs], key); if (inputCacheSaveIf == "true") { - core.info(`enabling cache with key ${key}`); + core.info(`enabling cache with key ${key}: [${cacheDirs}]`); core.saveState("ghjk-cache-save", true); core.saveState("ghjk-post-args", { key, @@ -145,7 +145,7 @@ export async function installGhjk( core.debug(`unable to find cached ghjk tool under version ${version}`); } } - core.debug(`installing ghjk using install.sh`); + core.debug(`installing ghjk using install.ts`); const installDir = process.env["GHJK_INSTALL_EXE_DIR"] ?? core.toPlatformPath(path.resolve(os.homedir(), ".local", "bin")); @@ -159,7 +159,7 @@ export async function installGhjk( // which won't be the same after tool cache restore env["GHJK_INSTALL_DENO_EXEC"] = "deno"; - core.debug(util.inspect({ denoExec, env }, false, undefined, false)); + core.debug(JSON.stringify({ denoExec, env }, undefined, " ")); await exec.exec(`"${denoExec}" run -A`, [installerUrl], { env }); if (version) { return await tc.cacheDir(installDir, "ghjk", version); diff --git a/gh_action/package.json b/gh_action/package.json index 23593384..0ba1060d 100644 --- a/gh_action/package.json +++ b/gh_action/package.json @@ -16,7 +16,7 @@ }, "scripts": { "lint": "pnpm dlx eslint . -c ./.github/linters/.eslintrc.yml", - "build:main": "ncc build main.ts -o dist/main .", + "build:main": "ncc build main.ts -o dist/main", "build:main:watch": "ncc build main.ts -w -o dist/main", "build:post": "ncc build post.ts -o dist/post", "build:post:watch": "ncc build post.ts -w -o dist/post"