Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use detectPlatform #28945

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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