diff --git a/lib/run.js b/lib/run.js index bb5bf124..a8badd32 100644 --- a/lib/run.js +++ b/lib/run.js @@ -1,9 +1,10 @@ "use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; @@ -74,6 +75,7 @@ function run() { version = yield getStableKubectlVersion(); } let cachedPath = yield downloadKubectl(version); + core.addPath(path.dirname(cachedPath)); console.log(`Kubectl tool version: '${version}' has been cached at ${cachedPath}`); core.setOutput('kubectl-path', cachedPath); }); diff --git a/src/run.ts b/src/run.ts index 4ba225df..f888a7f3 100644 --- a/src/run.ts +++ b/src/run.ts @@ -70,6 +70,9 @@ async function run() { version = await getStableKubectlVersion(); } let cachedPath = await downloadKubectl(version); + + core.addPath(path.dirname(cachedPath)); + console.log(`Kubectl tool version: '${version}' has been cached at ${cachedPath}`); core.setOutput('kubectl-path', cachedPath); }