Update run.ts

This commit is contained in:
Sundar 2021-05-29 09:25:27 +05:30 committed by GitHub
parent 5532186cb2
commit fc4eac4336
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -77,17 +77,17 @@ export async function downloadKubectl(version: string): Promise<string> {
return kubectlPath; return kubectlPath;
} }
export async function run() { // export async function run() {
let version = core.getInput('version', { 'required': true }); // let version = core.getInput('version', { 'required': true });
if (version.toLocaleLowerCase() === 'latest') { // if (version.toLocaleLowerCase() === 'latest') {
version = await getStableKubectlVersion(); // version = await getStableKubectlVersion();
} // }
let cachedPath = await downloadKubectl(version); // let cachedPath = await downloadKubectl(version);
core.addPath(path.dirname(cachedPath)); // core.addPath(path.dirname(cachedPath));
console.log(`Kubectl tool version: '${version}' has been cached at ${cachedPath}`); // console.log(`Kubectl tool version: '${version}' has been cached at ${cachedPath}`);
core.setOutput('kubectl-path', cachedPath); // core.setOutput('kubectl-path', cachedPath);
} // }
run().catch(core.setFailed); run().catch(core.setFailed);