Skip to content

Commit ed6cf9b

Browse files
committed
fix: fall back to a literal tag when a component ref is not a semver range
A ref of only digits matches the semver range pattern, but a tag literally named 9 or 0.1 is not valid semver, so range resolution found nothing and the assertion fired instead of using the ref as-is.
1 parent e3f4023 commit ed6cf9b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/parser-includes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,8 @@ export class ParserIncludes {
282282
const stdout = getGitRemoteInfo(this, "--tags");
283283
const tags = stdout.split("\n").map(line => line.split("\t")[1].split("/")[2]);
284284
const version = resolveSemanticVersionRange(this.reference, tags);
285-
assert(version, `This GitLab CI configuration is invalid: component: \`${this.name}\` - The reference (${this.reference}) is invalid`);
286-
this._cache.version = version;
285+
assert(version ?? tags.includes(this.reference), `This GitLab CI configuration is invalid: component: \`${this.name}\` - The reference (${this.reference}) is invalid`);
286+
this._cache.version = version ?? null;
287287
} else {
288288
this._cache.version = null;
289289
}

0 commit comments

Comments
 (0)