metadata-action/src/context.ts

27 lines
858 B
TypeScript
Raw Normal View History

import * as core from '@actions/core';
import {Util} from '@docker/actions-toolkit/lib/util';
2020-10-25 02:25:23 +01:00
export interface Inputs {
images: string[];
tags: string[];
flavor: string[];
labels: string[];
2020-10-25 02:25:23 +01:00
sepTags: string;
sepLabels: string;
bakeTarget: string;
2020-10-25 02:25:23 +01:00
githubToken: string;
}
export function getInputs(): Inputs {
return {
images: Util.getInputList('images', {ignoreComma: true}),
tags: Util.getInputList('tags', {ignoreComma: true}),
flavor: Util.getInputList('flavor', {ignoreComma: true}),
labels: Util.getInputList('labels', {ignoreComma: true}),
sepTags: core.getInput('sep-tags', {trimWhitespace: false}) || `\n`,
sepLabels: core.getInput('sep-labels', {trimWhitespace: false}) || `\n`,
bakeTarget: core.getInput('bake-target') || `docker-metadata-action`,
2020-10-25 02:25:23 +01:00
githubToken: core.getInput('github-token')
};
}