Added helm binary to the Path environment variable
This commit is contained in:
12
lib/run.js
12
lib/run.js
@ -22,8 +22,8 @@ const os = __importStar(require("os"));
|
||||
const path = __importStar(require("path"));
|
||||
const util = __importStar(require("util"));
|
||||
const fs = __importStar(require("fs"));
|
||||
const toolCache = __importStar(require("../node_modules/@actions/tool-cache"));
|
||||
const core = __importStar(require("../node_modules/@actions/core"));
|
||||
const toolCache = __importStar(require("@actions/tool-cache"));
|
||||
const core = __importStar(require("@actions/core"));
|
||||
const helmToolName = 'helm';
|
||||
const stableHelmVersion = 'v2.14.1';
|
||||
const helmLatestReleaseUrl = 'https://api.github.com/repos/helm/helm/releases/latest';
|
||||
@ -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);
|
||||
});
|
||||
|
Reference in New Issue
Block a user