mirror of
https://github.com/docker/metadata-action.git
synced 2025-06-24 03:37:59 +02:00
Prefix/suffix not taken into account (#62)
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
34
src/meta.ts
34
src/meta.ts
@ -99,11 +99,14 @@ export class Meta {
|
||||
}
|
||||
|
||||
const currentDate = this.date;
|
||||
const vraw = handlebars.compile(tag.attrs['pattern'])({
|
||||
date: function (format) {
|
||||
return moment(currentDate).utc().format(format);
|
||||
}
|
||||
});
|
||||
const vraw = this.setFlavor(
|
||||
handlebars.compile(tag.attrs['pattern'])({
|
||||
date: function (format) {
|
||||
return moment(currentDate).utc().format(format);
|
||||
}
|
||||
}),
|
||||
tag
|
||||
);
|
||||
|
||||
if (version.main == undefined) {
|
||||
version.main = vraw;
|
||||
@ -138,21 +141,16 @@ export class Meta {
|
||||
includePrerelease: true
|
||||
});
|
||||
if (semver.prerelease(vraw)) {
|
||||
vraw = handlebars.compile('{{version}}')(sver);
|
||||
if (version.main == undefined) {
|
||||
version.main = vraw;
|
||||
} else if (vraw !== version.main) {
|
||||
version.partial.push(vraw);
|
||||
}
|
||||
vraw = this.setFlavor(handlebars.compile('{{version}}')(sver), tag);
|
||||
} else {
|
||||
vraw = handlebars.compile(tag.attrs['pattern'])(sver);
|
||||
if (version.main == undefined) {
|
||||
version.main = vraw;
|
||||
} else if (vraw !== version.main) {
|
||||
version.partial.push(vraw);
|
||||
}
|
||||
vraw = this.setFlavor(handlebars.compile(tag.attrs['pattern'])(sver), tag);
|
||||
latest = true;
|
||||
}
|
||||
if (version.main == undefined) {
|
||||
version.main = vraw;
|
||||
} else if (vraw !== version.main) {
|
||||
version.partial.push(vraw);
|
||||
}
|
||||
if (version.latest == undefined) {
|
||||
version.latest = this.flavor.latest == 'auto' ? latest : this.flavor.latest == 'true';
|
||||
}
|
||||
@ -189,7 +187,7 @@ export class Meta {
|
||||
return version;
|
||||
}
|
||||
|
||||
vraw = tmatch[tag.attrs['group']];
|
||||
vraw = this.setFlavor(tmatch[tag.attrs['group']], tag);
|
||||
latest = true;
|
||||
|
||||
if (version.main == undefined) {
|
||||
|
Reference in New Issue
Block a user