Only replace tilde in certain scenarios

This commit is contained in:
Konrad Pabjan 2020-07-29 18:17:27 +02:00
parent 0bc4c5f195
commit 23faf7dc6f
2 changed files with 14 additions and 5 deletions

9
dist/index.js vendored
View file

@ -6642,8 +6642,13 @@ function run() {
try {
const name = core.getInput(constants_1.Inputs.Name, { required: false });
const path = core.getInput(constants_1.Inputs.Path, { required: false });
// resolve tilde expansion
const resolvedPath = path_1.resolve(path.replace('~', os.homedir));
let resolvedPath;
if (path === '~' || path.startsWith(`~${path_1.sep}`)) {
resolvedPath = path_1.resolve(path.replace('~', os.homedir()));
}
else {
resolvedPath = path_1.resolve(path);
}
core.debug(`Resolved path is ${resolvedPath}`);
const artifactClient = artifact.create();
if (!name) {