Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
818d4b7b91 | ||
|
948134af5e | ||
|
ef7eee951a | ||
|
8ec80c3be6 | ||
|
38650bbf6b | ||
|
ebbd9b4df7 | ||
|
2dadb92b6b | ||
|
2c0bd771b4 | ||
|
b10b364e15 | ||
|
40a1c6ff52 | ||
|
be8ea87c5a | ||
|
dbbf01822b | ||
|
72b4ec2b60 | ||
|
00e2c9d34e |
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -315,7 +315,7 @@ jobs:
|
||||
uses: docker/setup-buildx-action@v2
|
||||
-
|
||||
name: Build
|
||||
uses: docker/bake-action@v2
|
||||
uses: docker/bake-action@v3
|
||||
with:
|
||||
files: |
|
||||
./test/docker-bake.hcl
|
||||
|
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -16,7 +16,7 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Test
|
||||
uses: docker/bake-action@v2
|
||||
uses: docker/bake-action@v3
|
||||
with:
|
||||
targets: test
|
||||
-
|
||||
|
2
.github/workflows/validate.yml
vendored
2
.github/workflows/validate.yml
vendored
@@ -36,6 +36,6 @@ jobs:
|
||||
uses: actions/checkout@v3
|
||||
-
|
||||
name: Validate
|
||||
uses: docker/bake-action@v2
|
||||
uses: docker/bake-action@v3
|
||||
with:
|
||||
targets: ${{ matrix.target }}
|
||||
|
@@ -63,7 +63,24 @@ describe('getInputs', () => {
|
||||
sepTags: ',',
|
||||
tags: [],
|
||||
} as Inputs
|
||||
]
|
||||
],
|
||||
[
|
||||
2,
|
||||
new Map<string, string>([
|
||||
['images', 'moby/buildkit\n#comment\nghcr.io/moby/mbuildkit'],
|
||||
]),
|
||||
{
|
||||
context: ContextSource.workflow,
|
||||
bakeTarget: 'docker-metadata-action',
|
||||
flavor: [],
|
||||
githubToken: '',
|
||||
images: ['moby/buildkit', 'ghcr.io/moby/mbuildkit'],
|
||||
labels: [],
|
||||
sepLabels: '\n',
|
||||
sepTags: '\n',
|
||||
tags: [],
|
||||
} as Inputs
|
||||
],
|
||||
])(
|
||||
'[%d] given %p as inputs, returns %p',
|
||||
async (num: number, inputs: Map<string, string>, expected: Inputs) => {
|
||||
|
File diff suppressed because it is too large
Load Diff
28
dist/index.js
generated
vendored
28
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
@@ -31,9 +31,9 @@
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/github": "^5.1.1",
|
||||
"@docker/actions-toolkit": "^0.1.0",
|
||||
"@docker/actions-toolkit": "^0.5.0",
|
||||
"@renovate/pep440": "^1.0.0",
|
||||
"csv-parse": "^5.3.8",
|
||||
"csv-parse": "^5.4.0",
|
||||
"handlebars": "^4.7.7",
|
||||
"moment": "^2.29.4",
|
||||
"moment-timezone": "^0.5.43",
|
||||
|
@@ -19,10 +19,10 @@ export interface Inputs {
|
||||
export function getInputs(): Inputs {
|
||||
return {
|
||||
context: (core.getInput('context') || ContextSource.workflow) as ContextSource,
|
||||
images: Util.getInputList('images', {ignoreComma: true}),
|
||||
tags: Util.getInputList('tags', {ignoreComma: true}),
|
||||
flavor: Util.getInputList('flavor', {ignoreComma: true}),
|
||||
labels: Util.getInputList('labels', {ignoreComma: 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: '#'}),
|
||||
sepTags: core.getInput('sep-tags', {trimWhitespace: false}) || `\n`,
|
||||
sepLabels: core.getInput('sep-labels', {trimWhitespace: false}) || `\n`,
|
||||
bakeTarget: core.getInput('bake-target') || `docker-metadata-action`,
|
||||
|
13
src/meta.ts
13
src/meta.ts
@@ -466,7 +466,18 @@ export class Meta {
|
||||
`org.opencontainers.image.licenses=${this.repo.license?.spdx_id || ''}`
|
||||
];
|
||||
labels.push(...this.inputs.labels);
|
||||
return labels;
|
||||
|
||||
return Array.from(
|
||||
new Map<string, string>(
|
||||
labels
|
||||
.map(label => label.split('='))
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
.filter(([_key, ...values]) => values.length > 0)
|
||||
.map(([key, ...values]) => [key, values.join('=')] as [string, string])
|
||||
)
|
||||
)
|
||||
.sort((a, b) => a[0].localeCompare(b[0]))
|
||||
.map(([key, value]) => `${key}=${value}`);
|
||||
}
|
||||
|
||||
public getJSON(): unknown {
|
||||
|
48
yarn.lock
48
yarn.lock
@@ -606,10 +606,10 @@
|
||||
dependencies:
|
||||
"@jridgewell/trace-mapping" "0.3.9"
|
||||
|
||||
"@docker/actions-toolkit@^0.1.0":
|
||||
version "0.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@docker/actions-toolkit/-/actions-toolkit-0.1.0.tgz#592dbcaef5ebe8699ea95d9f62ca5d4ba73845b5"
|
||||
integrity sha512-Q9YQGSD3A+WjteCo/CstVzCNRfK0toejQtV1sNOMvXmFqc3TbXNszdGXAl/5Qdb6oRCYJ/Sa7FFLD/JTmQTpQQ==
|
||||
"@docker/actions-toolkit@^0.5.0":
|
||||
version "0.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@docker/actions-toolkit/-/actions-toolkit-0.5.0.tgz#4f2c215a1e67ce27edb10acf658b5289f8da7d7e"
|
||||
integrity sha512-VgU9KDmCgSVqpLwNVkf4JUP8Bg38dymuDJhMU0A5DRXtII/K+85peEY/in6U7ThyO1wSSef19ImpiIKYLFBqvA==
|
||||
dependencies:
|
||||
"@actions/core" "^1.10.0"
|
||||
"@actions/exec" "^1.1.1"
|
||||
@@ -617,11 +617,12 @@
|
||||
"@actions/http-client" "^2.0.1"
|
||||
"@actions/io" "^1.1.2"
|
||||
"@actions/tool-cache" "^2.0.1"
|
||||
"@octokit/plugin-rest-endpoint-methods" "^7.2.1"
|
||||
async-retry "^1.3.3"
|
||||
csv-parse "^5.3.6"
|
||||
csv-parse "^5.4.0"
|
||||
handlebars "^4.7.7"
|
||||
jwt-decode "^3.1.2"
|
||||
semver "^7.4.0"
|
||||
semver "^7.5.1"
|
||||
tmp "^0.2.1"
|
||||
|
||||
"@eslint-community/eslint-utils@^4.2.0":
|
||||
@@ -1005,6 +1006,11 @@
|
||||
resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-11.2.0.tgz#b38d7fc3736d52a1e96b230c1ccd4a58a2f400a6"
|
||||
integrity sha512-PBsVO+15KSlGmiI8QAzaqvsNlZlrDlyAJYcrXBCvVUxCp7VnXjkwPoFHgjEJXx3WF9BAwkA6nfCUA7i9sODzKA==
|
||||
|
||||
"@octokit/openapi-types@^18.0.0":
|
||||
version "18.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-18.0.0.tgz#f43d765b3c7533fd6fb88f3f25df079c24fccf69"
|
||||
integrity sha512-V8GImKs3TeQRxRtXFpG2wl19V7444NIOTDF24AWuIbmNaNYOQMWRbjcGDXV5B+0n887fgDcuMNOmlul+k+oJtw==
|
||||
|
||||
"@octokit/openapi-types@^7.2.0":
|
||||
version "7.2.1"
|
||||
resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-7.2.1.tgz#3ba1abe8906863edd403e185bc12e2bf79b3e240"
|
||||
@@ -1025,6 +1031,13 @@
|
||||
"@octokit/types" "^6.34.0"
|
||||
deprecation "^2.3.1"
|
||||
|
||||
"@octokit/plugin-rest-endpoint-methods@^7.2.1":
|
||||
version "7.2.1"
|
||||
resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-7.2.1.tgz#0e086930c8b4470b0eabaa7d68b67fd1b245bb3a"
|
||||
integrity sha512-UmlNrrcF+AXxcxhZslTt1a/8aDxUKH0trrt/mJCxEPrWbW1ZEc+6xxcd5/n0iw3b+Xo8UBJQUKDr71+vNCBpRQ==
|
||||
dependencies:
|
||||
"@octokit/types" "^9.3.1"
|
||||
|
||||
"@octokit/request-error@^2.0.0":
|
||||
version "2.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-2.0.2.tgz#0e76b83f5d8fdda1db99027ea5f617c2e6ba9ed0"
|
||||
@@ -1099,6 +1112,13 @@
|
||||
dependencies:
|
||||
"@octokit/openapi-types" "^11.2.0"
|
||||
|
||||
"@octokit/types@^9.3.1":
|
||||
version "9.3.1"
|
||||
resolved "https://registry.yarnpkg.com/@octokit/types/-/types-9.3.1.tgz#9eb20390f8cfcc975635d813f9a2094efd4aa2dd"
|
||||
integrity sha512-zfJzyXLHC42sWcn2kS+oZ/DRvFZBYCCbfInZtwp1Uopl1qh6pRg4NSP/wFX1xCOpXvEkctiG1sxlSlkZmzvxdw==
|
||||
dependencies:
|
||||
"@octokit/openapi-types" "^18.0.0"
|
||||
|
||||
"@renovate/pep440@^1.0.0":
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@renovate/pep440/-/pep440-1.0.0.tgz#9e05cac649b6a3d027cba7f2939b085de78f39ea"
|
||||
@@ -1752,10 +1772,10 @@ cross-spawn@^7.0.2, cross-spawn@^7.0.3:
|
||||
shebang-command "^2.0.0"
|
||||
which "^2.0.1"
|
||||
|
||||
csv-parse@*, csv-parse@^5.3.6, csv-parse@^5.3.8:
|
||||
version "5.3.8"
|
||||
resolved "https://registry.yarnpkg.com/csv-parse/-/csv-parse-5.3.8.tgz#c9919fbc5670fddec09a4b40e25365a2d11956d1"
|
||||
integrity sha512-ird8lzMv9I64oqIVIHdaTbT7Yr55n2C/Nv6m1LxO7nddLEeI67468VQ9Ik+r6lwYbK9kTE1oSqAVcVKc/Uqx6g==
|
||||
csv-parse@*, csv-parse@^5.4.0:
|
||||
version "5.4.0"
|
||||
resolved "https://registry.yarnpkg.com/csv-parse/-/csv-parse-5.4.0.tgz#6793210a4a49a9a74b3fde3f9d00f3f52044fd89"
|
||||
integrity sha512-JiQosUWiOFgp4hQn0an+SBoV9IKdqzhROM0iiN4LB7UpfJBlsSJlWl9nq4zGgxgMAzHJ6V4t29VAVD+3+2NJAg==
|
||||
|
||||
debug@^4.1.0, debug@^4.1.1:
|
||||
version "4.3.2"
|
||||
@@ -3265,10 +3285,10 @@ safe-buffer@~5.1.1:
|
||||
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
|
||||
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
|
||||
|
||||
semver@7.x, semver@^7.3.5, semver@^7.3.7, semver@^7.4.0, semver@^7.5.0:
|
||||
version "7.5.0"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.0.tgz#ed8c5dc8efb6c629c88b23d41dc9bf40c1d96cd0"
|
||||
integrity sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA==
|
||||
semver@7.x, semver@^7.3.5, semver@^7.3.7, semver@^7.5.0, semver@^7.5.1:
|
||||
version "7.5.1"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.1.tgz#c90c4d631cf74720e46b21c1d37ea07edfab91ec"
|
||||
integrity sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==
|
||||
dependencies:
|
||||
lru-cache "^6.0.0"
|
||||
|
||||
|
Reference in New Issue
Block a user