Skip to content

Commit

Permalink
dont write files outside GH workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
lukka committed Nov 12, 2023
1 parent 6fe6989 commit d42250c
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 47 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ build
.npmrc
coverage
.DS_Store
__tests__/b/
__tests__/theAssets/
__tests__/b
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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`
Expand Down
24 changes: 12 additions & 12 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand All @@ -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);
}
Expand All @@ -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

/***/ }),
Expand Down
50 changes: 25 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit d42250c

Please sign in to comment.