mirror of
https://github.com/docker/metadata-action.git
synced 2026-03-25 17:38:18 +00:00
Compare commits
4 Commits
v6
...
c255c9c200
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c255c9c200 | ||
|
|
e8d0bd119c | ||
|
|
302938f99d | ||
|
|
5a81aee75f |
@@ -79,67 +79,6 @@ describe('getInputs', () => {
|
||||
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) => {
|
||||
inputs.forEach((value: string, name: string) => {
|
||||
|
||||
@@ -66,5 +66,5 @@ outputs:
|
||||
description: 'Bake definition file with tags and labels'
|
||||
|
||||
runs:
|
||||
using: 'node24'
|
||||
using: 'node20'
|
||||
main: 'dist/index.js'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
ARG NODE_VERSION=24
|
||||
ARG NODE_VERSION=20
|
||||
|
||||
FROM node:${NODE_VERSION}-alpine AS base
|
||||
RUN apk add --no-cache cpio findutils git rsync
|
||||
|
||||
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
@@ -26,7 +26,7 @@
|
||||
"dependencies": {
|
||||
"@actions/core": "^3.0.0",
|
||||
"@actions/github": "^9.0.0",
|
||||
"@docker/actions-toolkit": "^0.79.0",
|
||||
"@docker/actions-toolkit": "^0.77.0",
|
||||
"@renovate/pep440": "^1.0.0",
|
||||
"csv-parse": "^6.1.0",
|
||||
"handlebars": "^4.7.8",
|
||||
@@ -36,7 +36,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.39.3",
|
||||
"@types/node": "^24.11.0",
|
||||
"@types/node": "^20.19.35",
|
||||
"@types/semver": "^7.7.1",
|
||||
"@typescript-eslint/eslint-plugin": "^8.56.1",
|
||||
"@typescript-eslint/parser": "^8.56.1",
|
||||
|
||||
@@ -28,11 +28,11 @@ export interface Inputs {
|
||||
export function getInputs(): Inputs {
|
||||
return {
|
||||
context: (core.getInput('context') || ContextSource.workflow) as ContextSource,
|
||||
images: Util.getInputList('images', {ignoreComma: true, comment: '#', commentNoInfix: true}),
|
||||
tags: Util.getInputList('tags', {ignoreComma: true, comment: '#', commentNoInfix: true}),
|
||||
flavor: Util.getInputList('flavor', {ignoreComma: true, comment: '#', commentNoInfix: true}),
|
||||
labels: Util.getInputList('labels', {ignoreComma: true, comment: '#', commentNoInfix: true}),
|
||||
annotations: Util.getInputList('annotations', {ignoreComma: true, comment: '#', commentNoInfix: true}),
|
||||
images: Util.getInputList('images', {ignoreComma: true, comment: '#'}),
|
||||
tags: Util.getInputList('tags', {ignoreComma: true, comment: '#'}),
|
||||
flavor: Util.getInputList('flavor', {ignoreComma: true, comment: '#'}),
|
||||
labels: Util.getInputList('labels', {ignoreComma: true, comment: '#'}),
|
||||
annotations: Util.getInputList('annotations', {ignoreComma: true, comment: '#'}),
|
||||
sepTags: core.getInput('sep-tags', {trimWhitespace: false}) || `\n`,
|
||||
sepLabels: core.getInput('sep-labels', {trimWhitespace: false}) || `\n`,
|
||||
sepAnnotations: core.getInput('sep-annotations', {trimWhitespace: false}) || `\n`,
|
||||
|
||||
30
yarn.lock
30
yarn.lock
@@ -376,9 +376,9 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@docker/actions-toolkit@npm:^0.79.0":
|
||||
version: 0.79.0
|
||||
resolution: "@docker/actions-toolkit@npm:0.79.0"
|
||||
"@docker/actions-toolkit@npm:^0.77.0":
|
||||
version: 0.77.0
|
||||
resolution: "@docker/actions-toolkit@npm:0.77.0"
|
||||
dependencies:
|
||||
"@actions/artifact": "npm:^6.2.0"
|
||||
"@actions/cache": "npm:^6.0.0"
|
||||
@@ -402,7 +402,7 @@ __metadata:
|
||||
semver: "npm:^7.7.4"
|
||||
tar-stream: "npm:^3.1.7"
|
||||
tmp: "npm:^0.2.5"
|
||||
checksum: 10/d64849ba49b2b59e2e93237a70be03fd7c43b1f7f01bac3f7557616ba5f59be785cb12a273bbb6a71c1e0d959f1bc6c673111b587c57bd2d6da105dcc500921a
|
||||
checksum: 10/f3ae817a5a6827efc63d1a1730e918801a8fa33867cda72bd7a1f78309631c45d91de60bc57985c7520fae168e96daed0fcab0003b5fab9b50bdd7aa355d651b
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -1325,12 +1325,12 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"@types/node@npm:^24.11.0":
|
||||
version: 24.11.0
|
||||
resolution: "@types/node@npm:24.11.0"
|
||||
"@types/node@npm:^20.19.35":
|
||||
version: 20.19.35
|
||||
resolution: "@types/node@npm:20.19.35"
|
||||
dependencies:
|
||||
undici-types: "npm:~7.16.0"
|
||||
checksum: 10/d2f4f898c6a0f14980e55c697904fb58681729fc46b4e264d5f64dc391b23da73c9b422cfffbca28c045e6e8eca72dab5f28ed633faa95398ef1528af5398382
|
||||
undici-types: "npm:~6.21.0"
|
||||
checksum: 10/f14fa74f9ae4d1109d8a8e3ec31b6518122b3d31c28fd5725cb3eef8ff64d7cf6f8da9c84c78b512e2968006ec325c82a413cc2062da7b3c3230c882e88babba
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
@@ -2142,10 +2142,10 @@ __metadata:
|
||||
dependencies:
|
||||
"@actions/core": "npm:^3.0.0"
|
||||
"@actions/github": "npm:^9.0.0"
|
||||
"@docker/actions-toolkit": "npm:^0.79.0"
|
||||
"@docker/actions-toolkit": "npm:^0.77.0"
|
||||
"@eslint/js": "npm:^9.39.3"
|
||||
"@renovate/pep440": "npm:^1.0.0"
|
||||
"@types/node": "npm:^24.11.0"
|
||||
"@types/node": "npm:^20.19.35"
|
||||
"@types/semver": "npm:^7.7.1"
|
||||
"@typescript-eslint/eslint-plugin": "npm:^8.56.1"
|
||||
"@typescript-eslint/parser": "npm:^8.56.1"
|
||||
@@ -4521,10 +4521,10 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"undici-types@npm:~7.16.0":
|
||||
version: 7.16.0
|
||||
resolution: "undici-types@npm:7.16.0"
|
||||
checksum: 10/db43439f69c2d94cc29f75cbfe9de86df87061d6b0c577ebe9bb3255f49b22c50162a7d7eb413b0458b6510b8ca299ac7cff38c3a29fbd31af9f504bcf7fbc0d
|
||||
"undici-types@npm:~6.21.0":
|
||||
version: 6.21.0
|
||||
resolution: "undici-types@npm:6.21.0"
|
||||
checksum: 10/ec8f41aa4359d50f9b59fa61fe3efce3477cc681908c8f84354d8567bb3701fafdddf36ef6bff307024d3feb42c837cf6f670314ba37fc8145e219560e473d14
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
||||
Reference in New Issue
Block a user