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

Allow global prefix/suffix on latest

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2021-07-05 20:37:02 +02:00
parent aa7478bca1
commit 375e313280
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
7 changed files with 245 additions and 59 deletions

View file

@ -159,7 +159,6 @@ export class Meta {
vraw = this.context.ref.replace(/^refs\/tags\//g, '').replace(/\//g, '-');
}
let latest: boolean = false;
let tmatch;
const isRegEx = tag.attrs['pattern'].match(/^\/(.+)\/(.*)$/);
if (isRegEx) {
@ -304,7 +303,7 @@ export class Meta {
tags.push(`${imageLc}:${partial}`);
}
if (this.version.latest) {
tags.push(`${imageLc}:latest`);
tags.push(`${imageLc}:${this.flavor.prefixLatest ? this.flavor.prefix : ''}latest${this.flavor.suffixLatest ? this.flavor.suffix : ''}`);
}
}
return tags;