Skip to content
Snippets Groups Projects
Unverified Commit a71bbf67 authored by Sergei Zharinov's avatar Sergei Zharinov Committed by GitHub
Browse files

fix(maven): Treat LATEST and RELEASE as non-version values (#7812)

parent 7fb4083f
No related branches found
No related tags found
No related merge requests found
...@@ -285,6 +285,9 @@ function isVersion(version: string): boolean { ...@@ -285,6 +285,9 @@ function isVersion(version: string): boolean {
if (/[.-]$/.test(version)) { if (/[.-]$/.test(version)) {
return false; return false;
} }
if (['latest', 'release'].includes(version.toLowerCase())) {
return false;
}
const tokens = tokenize(version); const tokens = tokenize(version);
return !!tokens.length; return !!tokens.length;
} }
......
...@@ -307,6 +307,11 @@ describe('versioning/maven/index', () => { ...@@ -307,6 +307,11 @@ describe('versioning/maven/index', () => {
expect(isVersion('-1')).toBe(false); expect(isVersion('-1')).toBe(false);
expect(isVersion('1-')).toBe(false); expect(isVersion('1-')).toBe(false);
expect(isVersion('[1.12.6,1.18.6]')).toBe(false); expect(isVersion('[1.12.6,1.18.6]')).toBe(false);
expect(isVersion('RELEASE')).toBe(false);
expect(isVersion('release')).toBe(false);
expect(isVersion('LATEST')).toBe(false);
expect(isVersion('latest')).toBe(false);
expect(isVersion('foobar')).toBe(true);
}); });
it('checks if version is stable', () => { it('checks if version is stable', () => {
expect(isStable('')).toBeNull(); expect(isStable('')).toBeNull();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment