Skip to content

Commit

Permalink
refactor: use detectPlatform (#28945)
Browse files Browse the repository at this point in the history
  • Loading branch information
RahulGautamSingh committed May 9, 2024
1 parent edf661f commit 5de7eee
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/workers/repository/update/pr/changelog/github/source.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import URL from 'node:url';
import { GlobalConfig } from '../../../../../../config/global';
import { logger } from '../../../../../../logger';
import { detectPlatform } from '../../../../../../util/common';
import * as hostRules from '../../../../../../util/host-rules';
import type { BranchUpgradeConfig } from '../../../../../types';
import { ChangeLogSource } from '../source';
Expand Down Expand Up @@ -42,8 +42,7 @@ export class GitHubChangeLogSource extends ChangeLogSource {
error?: ChangeLogError;
} {
const sourceUrl = config.sourceUrl!;
const parsedUrl = URL.parse(sourceUrl);
const host = parsedUrl.host;
const host = detectPlatform(sourceUrl);
const manager = config.manager;
const packageName = config.packageName;

Expand All @@ -57,7 +56,7 @@ export class GitHubChangeLogSource extends ChangeLogSource {
});
// istanbul ignore if
if (host && !token) {
if (host.endsWith('.git.luolix.top') || host === 'github.com') {
if (host === 'github') {
if (!GlobalConfig.get('githubTokenWarn')) {
logger.debug(
{ manager, packageName, sourceUrl },
Expand Down

0 comments on commit 5de7eee

Please sign in to comment.