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:
parent
62339db73c
commit
3e5e65e4c1
5 changed files with 161 additions and 3 deletions
|
@ -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>(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue