mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-13 15:36:25 +00:00
refactor: use detectPlatform
(#28945)
This commit is contained in:
parent
edf661ff73
commit
5de7eee2b3
1 changed files with 3 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
||||||
import URL from 'node:url';
|
|
||||||
import { GlobalConfig } from '../../../../../../config/global';
|
import { GlobalConfig } from '../../../../../../config/global';
|
||||||
import { logger } from '../../../../../../logger';
|
import { logger } from '../../../../../../logger';
|
||||||
|
import { detectPlatform } from '../../../../../../util/common';
|
||||||
import * as hostRules from '../../../../../../util/host-rules';
|
import * as hostRules from '../../../../../../util/host-rules';
|
||||||
import type { BranchUpgradeConfig } from '../../../../../types';
|
import type { BranchUpgradeConfig } from '../../../../../types';
|
||||||
import { ChangeLogSource } from '../source';
|
import { ChangeLogSource } from '../source';
|
||||||
|
@ -42,8 +42,7 @@ export class GitHubChangeLogSource extends ChangeLogSource {
|
||||||
error?: ChangeLogError;
|
error?: ChangeLogError;
|
||||||
} {
|
} {
|
||||||
const sourceUrl = config.sourceUrl!;
|
const sourceUrl = config.sourceUrl!;
|
||||||
const parsedUrl = URL.parse(sourceUrl);
|
const host = detectPlatform(sourceUrl);
|
||||||
const host = parsedUrl.host;
|
|
||||||
const manager = config.manager;
|
const manager = config.manager;
|
||||||
const packageName = config.packageName;
|
const packageName = config.packageName;
|
||||||
|
|
||||||
|
@ -57,7 +56,7 @@ export class GitHubChangeLogSource extends ChangeLogSource {
|
||||||
});
|
});
|
||||||
// istanbul ignore if
|
// istanbul ignore if
|
||||||
if (host && !token) {
|
if (host && !token) {
|
||||||
if (host.endsWith('.github.com') || host === 'github.com') {
|
if (host === 'github') {
|
||||||
if (!GlobalConfig.get('githubTokenWarn')) {
|
if (!GlobalConfig.get('githubTokenWarn')) {
|
||||||
logger.debug(
|
logger.debug(
|
||||||
{ manager, packageName, sourceUrl },
|
{ manager, packageName, sourceUrl },
|
||||||
|
|
Loading…
Reference in a new issue