From 3b5eac6cd332fb9127a6812221e786c4c5cadeab Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 18 May 2021 23:06:03 -0700 Subject: [PATCH 1/2] Remove unused tempDirectory definition code --- dist/index.js | 16 ---------------- src/installer.ts | 15 --------------- 2 files changed, 31 deletions(-) diff --git a/dist/index.js b/dist/index.js index b47fb0cc..b30874e6 100644 --- a/dist/index.js +++ b/dist/index.js @@ -47,7 +47,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getTask = void 0; -// Load tempDirectory before it gets wiped by tool-cache const os = __importStar(__nccwpck_require__(2087)); const path = __importStar(__nccwpck_require__(5622)); const util = __importStar(__nccwpck_require__(1669)); @@ -55,21 +54,6 @@ const restm = __importStar(__nccwpck_require__(7405)); const semver = __importStar(__nccwpck_require__(1383)); const core = __importStar(__nccwpck_require__(2186)); const tc = __importStar(__nccwpck_require__(7784)); -let tempDirectory = process.env.RUNNER_TEMP || ""; -if (!tempDirectory) { - let baseLocation; - if (process.platform === "win32") { - // On windows use the USERPROFILE env variable - baseLocation = process.env.USERPROFILE || "C:\\"; - } - else if (process.platform === "darwin") { - baseLocation = "/Users"; - } - else { - baseLocation = "/home"; - } - tempDirectory = path.join(baseLocation, "actions", "temp"); -} const io = __nccwpck_require__(7436); const osPlat = os.platform(); const osArch = os.arch(); diff --git a/src/installer.ts b/src/installer.ts index 48511b3c..c4088b5a 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -10,7 +10,6 @@ // software without disclosing the source code of your own applications. To purchase // a commercial license, send an email to license@arduino.cc -// Load tempDirectory before it gets wiped by tool-cache import * as os from "os"; import * as path from "path"; import * as util from "util"; @@ -20,20 +19,6 @@ import * as semver from "semver"; import * as core from "@actions/core"; import * as tc from "@actions/tool-cache"; -let tempDirectory = process.env.RUNNER_TEMP || ""; - -if (!tempDirectory) { - let baseLocation; - if (process.platform === "win32") { - // On windows use the USERPROFILE env variable - baseLocation = process.env.USERPROFILE || "C:\\"; - } else if (process.platform === "darwin") { - baseLocation = "/Users"; - } else { - baseLocation = "/home"; - } - tempDirectory = path.join(baseLocation, "actions", "temp"); -} import io = require("@actions/io"); const osPlat: string = os.platform(); From ee66277aca93e8c0652878f96bbbabbe67342943 Mon Sep 17 00:00:00 2001 From: per1234 Date: Tue, 18 May 2021 23:11:29 -0700 Subject: [PATCH 2/2] Correct name of workflow step for setting up Node.js The version number is clearly shown in the action input, so there is no need to specify it in the step name. --- .github/workflows/test-typescript-task.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-typescript-task.yml b/.github/workflows/test-typescript-task.yml index 4d92c220..d4100dff 100644 --- a/.github/workflows/test-typescript-task.yml +++ b/.github/workflows/test-typescript-task.yml @@ -47,7 +47,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Set Node.js 10.x + - name: Setup Node.js uses: actions/setup-node@v2 with: node-version: 12.x