Skip to content

Commit

Permalink
Sanitize tag earlier
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed May 5, 2022
1 parent f206c36 commit 2f5b5ae
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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 : ''}`;
Expand Down

0 comments on commit 2f5b5ae

Please sign in to comment.