From 1e2879cd729f5e7dda833e0745e6e66da8577df6 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Fri, 23 Apr 2021 23:25:00 +0200 Subject: [PATCH] Fix setOutput behavior Signed-off-by: CrazyMax --- dist/index.js | 7 ++++++- src/main.ts | 8 +++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 18b2978..de59055 100644 --- a/dist/index.js +++ b/dist/index.js @@ -93,6 +93,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); const mexec = __importStar(__webpack_require__(757)); const core = __importStar(__webpack_require__(186)); const exec = __importStar(__webpack_require__(514)); +const command_1 = __webpack_require__(241); function run() { return __awaiter(this, void 0, void 0, function* () { try { @@ -115,7 +116,7 @@ function run() { } const platforms = JSON.parse(res.stdout.trim()); core.info(`${platforms.supported.join(',')}`); - core.setOutput('platforms', platforms.supported.join(',')); + setOutput('platforms', platforms.supported.join(',')); }); core.endGroup(); } @@ -124,6 +125,10 @@ function run() { } }); } +// FIXME: Temp fix https://github.com/actions/toolkit/issues/777 +function setOutput(name, value) { + command_1.issueCommand('set-output', { name }, value); +} run(); //# sourceMappingURL=main.js.map diff --git a/src/main.ts b/src/main.ts index e9f8fa8..6fac8a5 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,6 +1,7 @@ import * as mexec from './exec'; import * as core from '@actions/core'; import * as exec from '@actions/exec'; +import {issueCommand} from '@actions/core/lib/command'; interface Platforms { supported: string[]; @@ -32,7 +33,7 @@ async function run(): Promise { } const platforms: Platforms = JSON.parse(res.stdout.trim()); core.info(`${platforms.supported.join(',')}`); - core.setOutput('platforms', platforms.supported.join(',')); + setOutput('platforms', platforms.supported.join(',')); }); core.endGroup(); } catch (error) { @@ -40,4 +41,9 @@ async function run(): Promise { } } +// FIXME: Temp fix https://github.com/actions/toolkit/issues/777 +function setOutput(name: string, value: any): void { + issueCommand('set-output', {name}, value); +} + run();