Use context for inputs

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2022-10-08 18:39:00 +02:00
parent 8c1e35a8c6
commit 25725d8d2e
5 changed files with 59 additions and 41 deletions

19
src/context.ts Normal file
View File

@ -0,0 +1,19 @@
import * as core from '@actions/core';
import {issueCommand} from '@actions/core/lib/command';
export interface Inputs {
image: string;
platforms: string;
}
export function getInputs(): Inputs {
return {
image: core.getInput('image') || 'tonistiigi/binfmt:latest',
platforms: core.getInput('platforms') || 'all'
};
}
// FIXME: Temp fix https://github.com/actions/toolkit/issues/777
export function setOutput(name: string, value: unknown): void {
issueCommand('set-output', {name}, value);
}