chore(bazel): Log non-https URLs for git_repository (#20467)

This commit is contained in:
Sergei Zharinov 2023-02-17 10:16:49 +03:00 committed by GitHub
parent 91822a60cb
commit 1dad5645e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,6 @@
import parseGithubUrl from 'github-url-from-git';
import { z } from 'zod';
import { logger } from '../../../../logger';
import { regEx } from '../../../../util/regex';
import { GithubReleasesDatasource } from '../../../datasource/github-releases';
import type { PackageDependency } from '../../types';
@ -9,6 +10,10 @@ const githubUrlRegex = regEx(
);
function githubPackageName(input: string): string | undefined {
// istanbul ignore if
if (!input.startsWith('https://')) {
logger.once.info({ url: input }, `Bazel: non-https git_repository URL`);
}
return parseGithubUrl(input)?.match(githubUrlRegex)?.groups?.packageName;
}