2
0
Fork 0
mirror of https://code.forgejo.org/docker/metadata-action.git synced 2025-09-17 10:16:57 +00:00

labelPrefix flavor for annotations support

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2023-10-25 16:54:32 +02:00
parent 62339db73c
commit 3e5e65e4c1
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
5 changed files with 161 additions and 3 deletions

View file

@ -455,7 +455,7 @@ export class Meta {
}
public getLabels(): Array<string> {
const labels: Array<string> = [
let labels: Array<string> = [
`org.opencontainers.image.title=${this.repo.name || ''}`,
`org.opencontainers.image.description=${this.repo.description || ''}`,
`org.opencontainers.image.url=${this.repo.html_url || ''}`,
@ -466,6 +466,9 @@ export class Meta {
`org.opencontainers.image.licenses=${this.repo.license?.spdx_id || ''}`
];
labels.push(...this.inputs.labels);
if (this.flavor.labelPrefix.length > 0) {
labels = labels.map(label => this.flavor.labelPrefix + label);
}
return Array.from(
new Map<string, string>(