Skip to content

Commit

Permalink
Merge pull request #31 from crazy-max/fix-setoutput
Browse files Browse the repository at this point in the history
Fix setOutput behavior
  • Loading branch information
crazy-max committed Apr 23, 2021
2 parents a803c66 + 1e2879c commit c308fdd
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 c308fdd

Please sign in to comment.