mirror of
https://gitea.com/docker/metadata-action.git
synced 2024-11-25 13:39:33 +01:00
dedup and sort labels
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
2c0bd771b4
commit
2dadb92b6b
2 changed files with 734 additions and 723 deletions
File diff suppressed because it is too large
Load diff
13
src/meta.ts
13
src/meta.ts
|
@ -466,7 +466,18 @@ export class Meta {
|
||||||
`org.opencontainers.image.licenses=${this.repo.license?.spdx_id || ''}`
|
`org.opencontainers.image.licenses=${this.repo.license?.spdx_id || ''}`
|
||||||
];
|
];
|
||||||
labels.push(...this.inputs.labels);
|
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 {
|
public getJSON(): unknown {
|
||||||
|
|
Loading…
Reference in a new issue