3
0
Fork 0
mirror of https://gitea.com/docker/metadata-action.git synced 2024-11-25 13:39:33 +01:00

Sanitize tag earlier

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2022-05-05 13:54:54 +02:00
parent f206c36955
commit 2f5b5ae8bf
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
3 changed files with 5 additions and 4 deletions

2
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View file

@ -312,6 +312,7 @@ export class Meta {
if (val.length == 0) {
return version;
}
val = Meta.sanitizeTag(val);
if (version.main == undefined) {
version.main = val;
} else if (val !== version.main) {
@ -424,9 +425,9 @@ export class Meta {
}
const tags: Array<string> = [];
for (const imageName of this.getImageNames()) {
tags.push(`${imageName}:${Meta.sanitizeTag(this.version.main)}`);
tags.push(`${imageName}:${this.version.main}`);
for (const partial of this.version.partial) {
tags.push(`${imageName}:${Meta.sanitizeTag(partial)}`);
tags.push(`${imageName}:${partial}`);
}
if (this.version.latest) {
const latestTag = `${this.flavor.prefixLatest ? this.flavor.prefix : ''}latest${this.flavor.suffixLatest ? this.flavor.suffix : ''}`;