Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix setOutput behavior
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
  • Loading branch information
CrazyMax committed Apr 23, 2021
1 parent a803c66 commit 1e2879c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion 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[];
Expand Down Expand Up @@ -32,12 +33,17 @@ async function run(): Promise<void> {
}
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) {
core.setFailed(error.message);
}
}

// FIXME: Temp fix https://github.com/actions/toolkit/issues/777
function setOutput(name: string, value: any): void {
issueCommand('set-output', {name}, value);
}

run();

0 comments on commit 1e2879c

Please sign in to comment.