From b6bc47f32ed0e385ffa2a5cf1d1a2c822b744f4c Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Wed, 6 Sep 2023 21:11:30 +0200 Subject: [PATCH] fix(changelogs): protect against null host (#24281) --- lib/workers/repository/update/pr/changelog/github/source.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/workers/repository/update/pr/changelog/github/source.ts b/lib/workers/repository/update/pr/changelog/github/source.ts index af62ea1e2b69f2..49eb858f99532b 100644 --- a/lib/workers/repository/update/pr/changelog/github/source.ts +++ b/lib/workers/repository/update/pr/changelog/github/source.ts @@ -42,7 +42,7 @@ export class GitHubChangeLogSource extends ChangeLogSource { } { const sourceUrl = config.sourceUrl!; const parsedUrl = URL.parse(sourceUrl); - const host = parsedUrl.host!; + const host = parsedUrl.host; const manager = config.manager; const packageName = config.packageName; @@ -54,7 +54,7 @@ export class GitHubChangeLogSource extends ChangeLogSource { url, }); // istanbul ignore if - if (!token) { + if (host && !token) { if (host.endsWith('.github.com') || host === 'github.com') { if (!GlobalConfig.get('githubTokenWarn')) { logger.debug(