fix: don't semver filter git-refs and git-tags (#13043)

Closes #13034

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
This commit is contained in:
Rhys Arkins 2021-12-10 10:12:21 +01:00 committed by GitHub
parent bcea3254ad
commit eeedadede7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 5 deletions

View file

@ -1,6 +1,5 @@
import { cache } from '../../util/cache/package/decorator'; import { cache } from '../../util/cache/package/decorator';
import { regEx } from '../../util/regex'; import { regEx } from '../../util/regex';
import * as semver from '../../versioning/semver';
import { Datasource } from '../datasource'; import { Datasource } from '../datasource';
import type { DigestConfig, GetReleasesConfig, ReleaseResult } from '../types'; import type { DigestConfig, GetReleasesConfig, ReleaseResult } from '../types';
import { GitDatasource } from './base'; import { GitDatasource } from './base';
@ -32,8 +31,7 @@ export class GitRefsDatasource extends Datasource {
const refs = rawRefs const refs = rawRefs
.filter((ref) => ref.type === 'tags' || ref.type === 'heads') .filter((ref) => ref.type === 'tags' || ref.type === 'heads')
.map((ref) => ref.value) .map((ref) => ref.value);
.filter((ref) => semver.isVersion(ref));
const uniqueRefs = [...new Set(refs)]; const uniqueRefs = [...new Set(refs)];

View file

@ -1,6 +1,5 @@
import { cache } from '../../util/cache/package/decorator'; import { cache } from '../../util/cache/package/decorator';
import { regEx } from '../../util/regex'; import { regEx } from '../../util/regex';
import * as semver from '../../versioning/semver';
import { Datasource } from '../datasource'; import { Datasource } from '../datasource';
import { GitDatasource } from '../git-refs/base'; import { GitDatasource } from '../git-refs/base';
import type { DigestConfig, GetReleasesConfig, ReleaseResult } from '../types'; import type { DigestConfig, GetReleasesConfig, ReleaseResult } from '../types';
@ -28,7 +27,6 @@ export class GitTagsDatasource extends Datasource {
} }
const releases = rawRefs const releases = rawRefs
.filter((ref) => ref.type === 'tags') .filter((ref) => ref.type === 'tags')
.filter((ref) => semver.isVersion(ref.value))
.map((ref) => ({ .map((ref) => ({
version: ref.value, version: ref.value,
gitRef: ref.value, gitRef: ref.value,