Adding tool binaries to PATH
This commit is contained in:
parent
9b492bbd34
commit
5e422a4552
2 changed files with 21 additions and 1 deletions
11
src/run.ts
11
src/run.ts
|
@ -70,6 +70,17 @@ async function run() {
|
|||
version = await getStableKubectlVersion();
|
||||
}
|
||||
let cachedPath = await downloadKubectl(version);
|
||||
|
||||
try {
|
||||
|
||||
if (!process.env['PATH'].startsWith(path.dirname(cachedPath))) {
|
||||
core.addPath(path.dirname(cachedPath));
|
||||
}
|
||||
}
|
||||
catch {
|
||||
//do nothing, set as output variable
|
||||
}
|
||||
|
||||
console.log(`Kubectl tool version: '${version}' has been cached at ${cachedPath}`);
|
||||
core.setOutput('kubectl-path', cachedPath);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue