2
0
Fork 0
mirror of https://code.forgejo.org/docker/metadata-action.git synced 2025-08-03 08:18:31 +00:00

Skip and display warning if tag does not match (#59)

Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2021-04-05 21:19:05 +02:00 committed by GitHub
parent e87dd9466c
commit 36ae18e02c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 142 additions and 25 deletions

View file

@ -180,10 +180,17 @@ export class Meta {
} else {
tmatch = vraw.match(tag.attrs['pattern']);
}
if (tmatch) {
vraw = tmatch[tag.attrs['group']];
latest = true;
if (!tmatch) {
core.warning(`${tag.attrs['pattern']} does not match ${vraw}.`);
return version;
}
if (typeof tmatch[tag.attrs['group']] === 'undefined') {
core.warning(`Group ${tag.attrs['group']} does not exist for ${tag.attrs['pattern']} pattern.`);
return version;
}
vraw = tmatch[tag.attrs['group']];
latest = true;
if (version.main == undefined) {
version.main = vraw;