Added helm binary to the Path environment variable

This commit is contained in:
Anumita Shenoy
2019-11-26 17:55:31 +05:30
parent 47b42933f7
commit 2b07de8ebf
4 changed files with 22 additions and 1 deletions

View File

@ -9,6 +9,8 @@ Acceptable values are latest or any semantic version string like 1.15.0. Use thi
version: '<version>' # default is latest stable
id: install
```
The cached helm binary path is prepended to the PATH environment variable as well as stored in the helm-path output variable.
Refer to the action metadata file for details about all the inputs https://github.com/Azure/setup-helm/blob/master/action.yml
# Contributing

View File

@ -119,6 +119,14 @@ function run() {
version = yield getStableHelmVersion();
}
let cachedPath = yield downloadHelm(version);
try {
if (!process.env['PATH'].startsWith(path.dirname(cachedPath))) {
core.addPath(path.dirname(cachedPath));
}
}
catch (_a) {
//do nothing, set as output variable
}
console.log(`Helm tool version: '${version}' has been cached at ${cachedPath}`);
core.setOutput('helm-path', cachedPath);
});

View File

@ -113,6 +113,17 @@ async function run() {
}
let cachedPath = await downloadHelm(version);
try {
if (!process.env['PATH'].startsWith(path.dirname(cachedPath))) {
core.addPath(path.dirname(cachedPath));
}
}
catch {
//do nothing, set as output variable
}
console.log(`Helm tool version: '${version}' has been cached at ${cachedPath}`);
core.setOutput('helm-path', cachedPath);
}

View File

@ -22,7 +22,7 @@
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
/* Strict Type-Checking Options */
"strict": true, /* Enable all strict type-checking options. */
//"strict": true, /* Enable all strict type-checking options. */
"noImplicitAny": false, /* Raise error on expressions and declarations with an implied 'any' type. */
// "strictNullChecks": true, /* Enable strict null checks. */
// "strictFunctionTypes": true, /* Enable strict checking of function types. */