refactor: setup context (#325)

Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2022-02-27 17:22:06 +01:00
committed by GitHub
parent a80c8fd82d
commit 39419c3fac
9 changed files with 208 additions and 152 deletions
+23
View File
@@ -0,0 +1,23 @@
import * as os from 'os';
import * as core from '@actions/core';
export const osPlat: string = os.platform();
export const osArch: string = os.arch();
export interface Inputs {
distribution: string;
version: string;
args: string;
workdir: string;
installOnly: boolean;
}
export async function getInputs(): Promise<Inputs> {
return {
distribution: core.getInput('distribution') || 'goreleaser',
version: core.getInput('version'),
args: core.getInput('args'),
workdir: core.getInput('workdir') || '.',
installOnly: core.getBooleanInput('install-only')
};
}