mirror of
https://github.com/docker/metadata-action.git
synced 2026-03-06 08:13:07 +08:00
Merge pull request #607 from crazy-max/allow-comments
Some checks are pending
ci / context (git) (push) Waiting to run
ci / context (workflow) (push) Waiting to run
ci / multi-images (push) Waiting to run
ci / tag-schedule () (push) Waiting to run
ci / tag-schedule (cron-{{date 'YYYYMMDD'}}) (push) Waiting to run
ci / tag-schedule (schedule) (push) Waiting to run
ci / tag-schedule ({{date 'YYYYMMDD-HHmmss'}}) (push) Waiting to run
ci / tag-match (\d.\d, 0) (push) Waiting to run
ci / tag-match (\d.\d.\d, 0) (push) Waiting to run
ci / tag-match (v(.*), 1) (push) Waiting to run
ci / tag-semver (auto) (push) Waiting to run
ci / tag-semver (false) (push) Waiting to run
ci / tag-semver (true) (push) Waiting to run
ci / flavor (push) Waiting to run
ci / images (push) Waiting to run
ci / custom-labels-annotations (push) Waiting to run
ci / global-exps (push) Waiting to run
ci / json (push) Waiting to run
ci / docker-push (push) Waiting to run
ci / bake (push) Waiting to run
ci / sep-tags ( ) (push) Waiting to run
ci / sep-tags (,) (push) Waiting to run
ci / output-env (push) Waiting to run
ci / no-output-env (push) Waiting to run
ci / bake-annotations (push) Waiting to run
ci / no-images (push) Waiting to run
ci / bake-path-context (push) Waiting to run
ci / sha-short () (push) Waiting to run
ci / sha-short (16) (push) Waiting to run
ci / dump (push) Waiting to run
test / test (push) Waiting to run
validate / prepare (push) Waiting to run
validate / validate (push) Blocked by required conditions
Some checks are pending
ci / context (git) (push) Waiting to run
ci / context (workflow) (push) Waiting to run
ci / multi-images (push) Waiting to run
ci / tag-schedule () (push) Waiting to run
ci / tag-schedule (cron-{{date 'YYYYMMDD'}}) (push) Waiting to run
ci / tag-schedule (schedule) (push) Waiting to run
ci / tag-schedule ({{date 'YYYYMMDD-HHmmss'}}) (push) Waiting to run
ci / tag-match (\d.\d, 0) (push) Waiting to run
ci / tag-match (\d.\d.\d, 0) (push) Waiting to run
ci / tag-match (v(.*), 1) (push) Waiting to run
ci / tag-semver (auto) (push) Waiting to run
ci / tag-semver (false) (push) Waiting to run
ci / tag-semver (true) (push) Waiting to run
ci / flavor (push) Waiting to run
ci / images (push) Waiting to run
ci / custom-labels-annotations (push) Waiting to run
ci / global-exps (push) Waiting to run
ci / json (push) Waiting to run
ci / docker-push (push) Waiting to run
ci / bake (push) Waiting to run
ci / sep-tags ( ) (push) Waiting to run
ci / sep-tags (,) (push) Waiting to run
ci / output-env (push) Waiting to run
ci / no-output-env (push) Waiting to run
ci / bake-annotations (push) Waiting to run
ci / no-images (push) Waiting to run
ci / bake-path-context (push) Waiting to run
ci / sha-short () (push) Waiting to run
ci / sha-short (16) (push) Waiting to run
ci / dump (push) Waiting to run
test / test (push) Waiting to run
validate / prepare (push) Waiting to run
validate / validate (push) Blocked by required conditions
preserve comments in list input values with commentNoInfix
This commit is contained in:
commit
030e881283
@ -79,6 +79,67 @@ describe('getInputs', () => {
|
|||||||
tags: [],
|
tags: [],
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
3,
|
||||||
|
new Map<string, string>([
|
||||||
|
['labels', 'mylabel=foo#bar\n#comment\nanother=bar'],
|
||||||
|
]),
|
||||||
|
{
|
||||||
|
context: context.ContextSource.workflow,
|
||||||
|
bakeTarget: 'docker-metadata-action',
|
||||||
|
flavor: [],
|
||||||
|
githubToken: '',
|
||||||
|
images: [],
|
||||||
|
labels: ['mylabel=foo#bar', 'another=bar'],
|
||||||
|
annotations: [],
|
||||||
|
sepLabels: '\n',
|
||||||
|
sepTags: '\n',
|
||||||
|
sepAnnotations: '\n',
|
||||||
|
tags: [],
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
4,
|
||||||
|
new Map<string, string>([
|
||||||
|
['annotations', 'org.opencontainers.image.url=https://example.com/path#readme\n#comment\norg.opencontainers.image.source=https://github.com/docker/metadata-action'],
|
||||||
|
]),
|
||||||
|
{
|
||||||
|
context: context.ContextSource.workflow,
|
||||||
|
bakeTarget: 'docker-metadata-action',
|
||||||
|
flavor: [],
|
||||||
|
githubToken: '',
|
||||||
|
images: [],
|
||||||
|
labels: [],
|
||||||
|
annotations: [
|
||||||
|
'org.opencontainers.image.url=https://example.com/path#readme',
|
||||||
|
'org.opencontainers.image.source=https://github.com/docker/metadata-action'
|
||||||
|
],
|
||||||
|
sepLabels: '\n',
|
||||||
|
sepTags: '\n',
|
||||||
|
sepAnnotations: '\n',
|
||||||
|
tags: [],
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
5,
|
||||||
|
new Map<string, string>([
|
||||||
|
['tags', 'type=raw,value=foo#bar\n#comment'],
|
||||||
|
['flavor', 'prefix=v#1\n#comment'],
|
||||||
|
]),
|
||||||
|
{
|
||||||
|
context: context.ContextSource.workflow,
|
||||||
|
bakeTarget: 'docker-metadata-action',
|
||||||
|
flavor: ['prefix=v#1'],
|
||||||
|
githubToken: '',
|
||||||
|
images: [],
|
||||||
|
labels: [],
|
||||||
|
annotations: [],
|
||||||
|
sepLabels: '\n',
|
||||||
|
sepTags: '\n',
|
||||||
|
sepAnnotations: '\n',
|
||||||
|
tags: ['type=raw,value=foo#bar'],
|
||||||
|
}
|
||||||
|
],
|
||||||
];
|
];
|
||||||
test.each(cases)('[%d] given %o as inputs, returns %o', async (num: number, inputs: Map<string, string>, expected: context.Inputs) => {
|
test.each(cases)('[%d] given %o as inputs, returns %o', async (num: number, inputs: Map<string, string>, expected: context.Inputs) => {
|
||||||
inputs.forEach((value: string, name: string) => {
|
inputs.forEach((value: string, name: string) => {
|
||||||
|
|||||||
2
dist/index.js
generated
vendored
2
dist/index.js
generated
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@ -28,11 +28,11 @@ export interface Inputs {
|
|||||||
export function getInputs(): Inputs {
|
export function getInputs(): Inputs {
|
||||||
return {
|
return {
|
||||||
context: (core.getInput('context') || ContextSource.workflow) as ContextSource,
|
context: (core.getInput('context') || ContextSource.workflow) as ContextSource,
|
||||||
images: Util.getInputList('images', {ignoreComma: true, comment: '#'}),
|
images: Util.getInputList('images', {ignoreComma: true, comment: '#', commentNoInfix: true}),
|
||||||
tags: Util.getInputList('tags', {ignoreComma: true, comment: '#'}),
|
tags: Util.getInputList('tags', {ignoreComma: true, comment: '#', commentNoInfix: true}),
|
||||||
flavor: Util.getInputList('flavor', {ignoreComma: true, comment: '#'}),
|
flavor: Util.getInputList('flavor', {ignoreComma: true, comment: '#', commentNoInfix: true}),
|
||||||
labels: Util.getInputList('labels', {ignoreComma: true, comment: '#'}),
|
labels: Util.getInputList('labels', {ignoreComma: true, comment: '#', commentNoInfix: true}),
|
||||||
annotations: Util.getInputList('annotations', {ignoreComma: true, comment: '#'}),
|
annotations: Util.getInputList('annotations', {ignoreComma: true, comment: '#', commentNoInfix: true}),
|
||||||
sepTags: core.getInput('sep-tags', {trimWhitespace: false}) || `\n`,
|
sepTags: core.getInput('sep-tags', {trimWhitespace: false}) || `\n`,
|
||||||
sepLabels: core.getInput('sep-labels', {trimWhitespace: false}) || `\n`,
|
sepLabels: core.getInput('sep-labels', {trimWhitespace: false}) || `\n`,
|
||||||
sepAnnotations: core.getInput('sep-annotations', {trimWhitespace: false}) || `\n`,
|
sepAnnotations: core.getInput('sep-annotations', {trimWhitespace: false}) || `\n`,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user