Skip and display warning if tag does not match

This commit is contained in:
CrazyMax 2021-04-05 21:13:07 +02:00
parent e87dd9466c
commit a6c89944cc
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
5 changed files with 142 additions and 25 deletions

12
dist/index.js generated vendored
View file

@ -518,10 +518,16 @@ 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;
}