From 31606bae104c3e04c7cb6a9599096cb6da9d947b Mon Sep 17 00:00:00 2001 From: Ed Ganiukov Date: Thu, 6 Apr 2023 13:55:48 +0200 Subject: [PATCH] auth: set NSC_TOKEN_FILE env var if token file exist --- dist/main/index.js | 7 +++---- main.ts | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/dist/main/index.js b/dist/main/index.js index d420f57..02b0112 100644 --- a/dist/main/index.js +++ b/dist/main/index.js @@ -4382,10 +4382,9 @@ Configured buildx to use remote Namespace Cloud build cluster.`); } function ensureNscloudToken() { return __awaiter(this, void 0, void 0, function* () { - const tokenSpecFile = "/var/run/nsc/token.spec"; - if (external_fs_.existsSync(tokenSpecFile)) { - const tokenSpec = external_fs_.readFileSync(tokenSpecFile, "utf8"); - core.exportVariable("NSC_TOKEN_SPEC", tokenSpec); + const tokenFile = "/var/run/nsc/token.json"; + if (external_fs_.existsSync(tokenFile)) { + core.exportVariable("NSC_TOKEN_FILE", tokenFile); return; } // We only need a valid token when opening the proxy diff --git a/main.ts b/main.ts index 7c0fb0e..14fca72 100644 --- a/main.ts +++ b/main.ts @@ -46,10 +46,9 @@ Configured buildx to use remote Namespace Cloud build cluster.`); } async function ensureNscloudToken() { - const tokenSpecFile = "/var/run/nsc/token.spec"; - if (fs.existsSync(tokenSpecFile)) { - const tokenSpec = fs.readFileSync(tokenSpecFile, "utf8"); - core.exportVariable("NSC_TOKEN_SPEC", tokenSpec); + const tokenFile = "/var/run/nsc/token.json"; + if (fs.existsSync(tokenFile)) { + core.exportVariable("NSC_TOKEN_FILE", tokenFile); return }