Skip to content

Commit ef7eee9

Browse files
committed
enable comments to avoid breaking change with current impl
Signed-off-by: CrazyMax <[email protected]>
1 parent 8ec80c3 commit ef7eee9

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

__tests__/context.test.ts

+18-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,24 @@ describe('getInputs', () => {
6363
sepTags: ',',
6464
tags: [],
6565
} as Inputs
66-
]
66+
],
67+
[
68+
2,
69+
new Map<string, string>([
70+
['images', 'moby/buildkit\n#comment\nghcr.io/moby/mbuildkit'],
71+
]),
72+
{
73+
context: ContextSource.workflow,
74+
bakeTarget: 'docker-metadata-action',
75+
flavor: [],
76+
githubToken: '',
77+
images: ['moby/buildkit', 'ghcr.io/moby/mbuildkit'],
78+
labels: [],
79+
sepLabels: '\n',
80+
sepTags: '\n',
81+
tags: [],
82+
} as Inputs
83+
],
6784
])(
6885
'[%d] given %p as inputs, returns %p',
6986
async (num: number, inputs: Map<string, string>, expected: Inputs) => {

src/context.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ export interface Inputs {
1919
export function getInputs(): Inputs {
2020
return {
2121
context: (core.getInput('context') || ContextSource.workflow) as ContextSource,
22-
images: Util.getInputList('images', {ignoreComma: true}),
23-
tags: Util.getInputList('tags', {ignoreComma: true}),
24-
flavor: Util.getInputList('flavor', {ignoreComma: true}),
25-
labels: Util.getInputList('labels', {ignoreComma: true}),
22+
images: Util.getInputList('images', {ignoreComma: true, comment: '#'}),
23+
tags: Util.getInputList('tags', {ignoreComma: true, comment: '#'}),
24+
flavor: Util.getInputList('flavor', {ignoreComma: true, comment: '#'}),
25+
labels: Util.getInputList('labels', {ignoreComma: true, comment: '#'}),
2626
sepTags: core.getInput('sep-tags', {trimWhitespace: false}) || `\n`,
2727
sepLabels: core.getInput('sep-labels', {trimWhitespace: false}) || `\n`,
2828
bakeTarget: core.getInput('bake-target') || `docker-metadata-action`,

0 commit comments

Comments
 (0)