Skip to content
Snippets Groups Projects
Unverified Commit 0fc2a556 authored by Rhys Arkins's avatar Rhys Arkins Committed by GitHub
Browse files

fix(git-refs): gracefully ignore git-refs auth error (#16617)

parent 47436a98
No related branches found
No related tags found
No related merge requests found
import { logger } from '../../../logger';
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 type { DigestConfig, GetReleasesConfig, ReleaseResult } from '../types'; import type { DigestConfig, GetReleasesConfig, ReleaseResult } from '../types';
...@@ -23,7 +24,13 @@ export class GitRefsDatasource extends GitDatasource { ...@@ -23,7 +24,13 @@ export class GitRefsDatasource extends GitDatasource {
override async getReleases({ override async getReleases({
packageName, packageName,
}: GetReleasesConfig): Promise<ReleaseResult | null> { }: GetReleasesConfig): Promise<ReleaseResult | null> {
const rawRefs: RawRefs[] | null = await this.getRawRefs({ packageName }); let rawRefs: RawRefs[] | null = null;
try {
rawRefs = await this.getRawRefs({ packageName });
} catch (err) /* istanbul ignore next */ {
logger.debug({ err }, 'Error getting git-refs');
}
if (!rawRefs) { if (!rawRefs) {
return null; return null;
...@@ -44,7 +51,7 @@ export class GitRefsDatasource extends GitDatasource { ...@@ -44,7 +51,7 @@ export class GitRefsDatasource extends GitDatasource {
releases: uniqueRefs.map((ref) => ({ releases: uniqueRefs.map((ref) => ({
version: ref, version: ref,
gitRef: ref, gitRef: ref,
newDigest: rawRefs.find((rawRef) => rawRef.value === ref)?.hash, newDigest: rawRefs!.find((rawRef) => rawRef.value === ref)?.hash,
})), })),
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment