From d42250cb2f1d4b925fe4e8abbdc9753dd3b53056 Mon Sep 17 00:00:00 2001 From: luca <681992+lukka@users.noreply.github.com> Date: Sat, 11 Nov 2023 23:34:19 -0800 Subject: [PATCH] dont write files outside GH workspace --- .gitignore | 3 ++- README.md | 8 ++++---- dist/index.js | 24 +++++++++++------------ package-lock.json | 50 +++++++++++++++++++++++------------------------ package.json | 10 +++++----- 5 files changed, 48 insertions(+), 47 deletions(-) diff --git a/.gitignore b/.gitignore index 6c84570b..feeddf30 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,5 @@ build .npmrc coverage .DS_Store -__tests__/b/ +__tests__/theAssets/ +__tests__/b \ No newline at end of file diff --git a/README.md b/README.md index 7b8f48d1..401799e8 100644 --- a/README.md +++ b/README.md @@ -176,10 +176,6 @@ Flowchart with related input in [action.yml](https://github.com/lukka/run-vcpkg/ └─────────────┬────────────┘ to run this block. ▼ ┌─────────────────────────┐ Inputs: - │ Locate vcpkg.json. │ - `vcpkgJsonGlob` - └────────────┬────────────┘ - `vcpkgJsonIgnores` - ▼ - ┌─────────────────────────┐ Inputs: | Skipped by default. | - `vcpkgDirectory` │ Restore vcpkg │ - `doNotCache`: set to false │ from the GH cache. │ to run this block. @@ -201,6 +197,10 @@ Flowchart with related input in [action.yml](https://github.com/lukka/run-vcpkg/ ────┬──── No│ - `runVcpkgInstall` │ Yes │ ▼ │ + ┌─────────────────────────┐ │ Inputs: + │ Locate vcpkg.json. │ │ - `vcpkgJsonGlob` + └────────────┬────────────┘ │ - `vcpkgJsonIgnores` + ▼ │ ┌─────────────────────────┐ │ │ Launch `vcpkg install` │ │ Inputs: │ where vcpkg.json has │ │ - `runVcpkgFormatString` diff --git a/dist/index.js b/dist/index.js index 99221b5b..6c44c7ca 100644 --- a/dist/index.js +++ b/dist/index.js @@ -44223,12 +44223,21 @@ class ActionLib { exist(path) { return ioutil.exists(path); } + static getDefaultBinDirName() { + let localBinDirName = ActionLib.binDir; + if (process.env.RUNVCPKG_BINDIR !== undefined) { + if (process.env.RUNVCPKG_BINDIR.length > 0) { + localBinDirName = process.env.RUNVCPKG_BINDIR; + } + } + return localBinDirName; + } getBinDir() { return __awaiter(this, void 0, void 0, function* () { if (!process.env.GITHUB_WORKSPACE) { throw new Error("GITHUB_WORKSPACE is not set."); } - const binPath = utils.BaseUtilLib.normalizePath(path.join(process.env.GITHUB_WORKSPACE, "../b/")); + const binPath = utils.BaseUtilLib.normalizePath(path.join(process.env.GITHUB_WORKSPACE, ActionLib.getDefaultBinDirName())); yield this.mkdirP(binPath); return binPath; }); @@ -44243,17 +44252,6 @@ class ActionLib { return srcPath; }); } - getArtifactsDir() { - return __awaiter(this, void 0, void 0, function* () { - if (!process.env.GITHUB_WORKSPACE) { - throw new Error("GITHUB_WORKSPACE env var is not set."); - } - //?? HACK. How to get the value of '{{ runner.temp }}' in JS's action? - const artifactsPath = utils.BaseUtilLib.normalizePath(path.join(process.env.GITHUB_WORKSPACE, "../../_temp")); - yield this.mkdirP(artifactsPath); - return artifactsPath; - }); - } beginOperation(message) { core.startGroup(message); } @@ -44274,6 +44272,8 @@ class ActionLib { } } exports.ActionLib = ActionLib; +ActionLib.binDir = "969f6665-88a2-4c98-938e-ca9259871fec"; +ActionLib.RUNVCPKG_BINDIR = "RUNVCPKG_BINDIR"; //# sourceMappingURL=action-lib.js.map /***/ }), diff --git a/package-lock.json b/package-lock.json index c432f8f9..b5628974 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,11 +15,11 @@ "@actions/github": "6.0.0", "@actions/glob": "^0.4.0", "@actions/io": "^1.1.3", - "@lukka/action-lib": "3.9.4", - "@lukka/assets-lib": "3.9.4", - "@lukka/base-lib": "3.9.4", - "@lukka/base-util-lib": "3.9.4", - "@lukka/run-vcpkg-lib": "3.9.4", + "@lukka/action-lib": "3.10.1", + "@lukka/assets-lib": "3.10.1", + "@lukka/base-lib": "3.10.1", + "@lukka/base-util-lib": "3.10.1", + "@lukka/run-vcpkg-lib": "3.10.1", "@types/adm-zip": "^0.4.32", "@types/follow-redirects": "^1.14.1", "@types/jest": "29.5.6", @@ -1435,9 +1435,9 @@ } }, "node_modules/@lukka/action-lib": { - "version": "3.9.4", - "resolved": "https://npm.pkg.github.com/download/@lukka/action-lib/3.9.4/85d0be69439ebd2b7dc3ff1355ed07c2bb0a75ea", - "integrity": "sha512-ToJ9wSPWNd+bb6tGaNTWylPibkOUy2em26j07JMnRKkeV4MJSSmPVbTktuYdJcyRmDZcpk2XI1nj5g5Wj2XSMg==", + "version": "3.10.1", + "resolved": "https://npm.pkg.github.com/download/@lukka/action-lib/3.10.1/dee9e74cbc879804414f395f472d3a62b2394dfd", + "integrity": "sha512-VgeaSTpvWdziazSKb9KXvRmXi3viZ5i/C/Tp4nw1siDHwIlhuLzpLumjukbnsZUnNIJG9emzdWtecJdcachH8A==", "license": "MIT", "dependencies": { "@actions/core": "1.10.1", @@ -1445,29 +1445,29 @@ "@actions/github": "^6.0.0", "@actions/glob": "0.4.0", "@actions/io": "1.1.3", - "@lukka/base-lib": "^3.9.4", - "@lukka/base-util-lib": "^3.9.4" + "@lukka/base-lib": "^3.10.1", + "@lukka/base-util-lib": "^3.10.1" } }, "node_modules/@lukka/assets-lib": { - "version": "3.9.4", - "resolved": "https://npm.pkg.github.com/download/@lukka/assets-lib/3.9.4/50371a24ffff33327e4f09091e4357758910b96c", - "integrity": "sha512-Lea/SeTRDvoOXBgJfdHzCNKMVlx8Zna5xlSWVCfn2LpmbUd+sq1Q8gviEVz6Gl9D6dukwnmouadrLmykSMCCHA==", + "version": "3.10.1", + "resolved": "https://npm.pkg.github.com/download/@lukka/assets-lib/3.10.1/e8275db71b62227468b073819f4da8d4f4dc7d30", + "integrity": "sha512-W83dLltRAzgKyS3A8HPiMVCSHUPDxXXPp+MVJxrb/e6rcZhnI6AW3TuzVfTXE+iww/Vqobbtd//9/mq1M4HyJQ==", "license": "MIT" }, "node_modules/@lukka/base-lib": { - "version": "3.9.4", - "resolved": "https://npm.pkg.github.com/download/@lukka/base-lib/3.9.4/d0e5068c57f5e936eb6c2f798dafae0208d94f54", - "integrity": "sha512-62eP2SvNUWS0xWF0I+yct+UXBJiiwJ/abNZlRdLZ4GlEnUOfjWZYC4mFC3tf45D5TmnjmiurOPPWoG8XS4EjDw==", + "version": "3.10.1", + "resolved": "https://npm.pkg.github.com/download/@lukka/base-lib/3.10.1/1f6e06739a250cfcd7713e39d5851f414db0fe48", + "integrity": "sha512-RyahTiNw/09uIWSBpggnmr1OIw+wNfqxBadVw27f6Vk8tka/5lSrn6Rq+1fTRbbCe8LaI4whoiYQK6WOLI5vbg==", "license": "MIT" }, "node_modules/@lukka/base-util-lib": { - "version": "3.9.4", - "resolved": "https://npm.pkg.github.com/download/@lukka/base-util-lib/3.9.4/01846dcc96ed853ece77ab80741b9c6b1c678a80", - "integrity": "sha512-ZaEVWyt3t6i2sum9Ld6qeX1wRLbOdpW91DhOJ7OGLhvTms3DU6zDv+fOxfMTrS5lySXUmb5shB6HLh/Dx19meg==", + "version": "3.10.1", + "resolved": "https://npm.pkg.github.com/download/@lukka/base-util-lib/3.10.1/938baffca81c29ae63a5755d6c03a0b23c7edc19", + "integrity": "sha512-25r9PjSgFqU6VUA6QA9aZDj1iff0D9w7v9kqNxl6yuWH8pKb29B+sdrwEKliRwdN0U5UuE8X2pfUJi497GU4Ug==", "license": "MIT", "dependencies": { - "@lukka/base-lib": "^3.9.4", + "@lukka/base-lib": "^3.10.1", "del": "^5", "fast-glob": "^3.3.1", "using-statement": "^0.4.2" @@ -1500,13 +1500,13 @@ } }, "node_modules/@lukka/run-vcpkg-lib": { - "version": "3.9.4", - "resolved": "https://npm.pkg.github.com/download/@lukka/run-vcpkg-lib/3.9.4/2ac5f82de33b196e62077d4f2218273d09b3b8a2", - "integrity": "sha512-4krDSRG/Un1R8B3fjj8dWMDPqY9xSaKx+/vm18ABjVcDGSSZhYSEDgQ1OTqGjp4yQnBhYRMMDXQSfEzdJ/yaxw==", + "version": "3.10.1", + "resolved": "https://npm.pkg.github.com/download/@lukka/run-vcpkg-lib/3.10.1/3d843b69b08dc00f9055f0674f78089496926c16", + "integrity": "sha512-KHFmJudC17B4H1w8G0HY5fII/CyPNKML8r5Bo5D6L+TnX3rmTYZD/uNdc5BhcTivq7QQ/1xGqtV9mBAb9iGBKg==", "license": "MIT", "dependencies": { - "@lukka/base-lib": "^3.9.4", - "@lukka/base-util-lib": "^3.9.4", + "@lukka/base-lib": "^3.10.1", + "@lukka/base-util-lib": "^3.10.1", "using-statement": "^0.4.2" } }, diff --git a/package.json b/package.json index 525ce705..560db606 100644 --- a/package.json +++ b/package.json @@ -40,11 +40,11 @@ "@actions/github": "6.0.0", "@actions/glob": "^0.4.0", "@actions/io": "^1.1.3", - "@lukka/action-lib": "3.9.4", - "@lukka/assets-lib": "3.9.4", - "@lukka/base-lib": "3.9.4", - "@lukka/base-util-lib": "3.9.4", - "@lukka/run-vcpkg-lib": "3.9.4", + "@lukka/action-lib": "3.10.1", + "@lukka/assets-lib": "3.10.1", + "@lukka/base-lib": "3.10.1", + "@lukka/base-util-lib": "3.10.1", + "@lukka/run-vcpkg-lib": "3.10.1", "@types/adm-zip": "^0.4.32", "@types/follow-redirects": "^1.14.1", "@types/jest": "29.5.6",