2
0
Fork 0
mirror of https://code.forgejo.org/docker/metadata-action.git synced 2025-08-26 16:00:54 +00:00

Pre-release (rc, beta, alpha) will only extend {{version}} as tag for tag-semver

This commit is contained in:
CrazyMax 2020-11-20 23:12:14 +01:00
parent 0dca12c226
commit 7cb65aaacb
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
5 changed files with 34 additions and 22 deletions

View file

@ -47,9 +47,11 @@ export class Meta {
const sver = semver.parse(version.main, {
includePrerelease: true
});
version.latest = !semver.prerelease(version.main);
version.main = handlebars.compile(this.inputs.tagSemver[0])(sver);
if (version.latest) {
if (semver.prerelease(version.main)) {
version.main = handlebars.compile('{{version}}')(sver);
} else {
version.latest = true;
version.main = handlebars.compile(this.inputs.tagSemver[0])(sver);
for (const semverTpl of this.inputs.tagSemver) {
const partial = handlebars.compile(semverTpl)(sver);
if (partial == version.main) {