Skip to content

Commit

Permalink
chore(git): use PLATFORM_HOST_TYPES as supported git hosts for gitAll…
Browse files Browse the repository at this point in the history
…owedHostTypes (#30643)
  • Loading branch information
Shegox committed Aug 7, 2024
1 parent 6d2f278 commit 9008c2e
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions lib/util/git/auth.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { PlatformId } from '../../constants/platforms';
import { PLATFORM_HOST_TYPES } from '../../constants/platforms';
import { logger } from '../../logger';
import type { HostRule } from '../../types';
import { detectPlatform } from '../common';
Expand All @@ -15,16 +15,6 @@ const githubApiUrls = new Set([
'https://api.github.com/',
]);

const standardGitAllowedHostTypes = [
// All known git platforms
'azure',
'bitbucket',
'bitbucket-server',
'gitea',
'github',
'gitlab',
] satisfies PlatformId[];

/**
* Add authorization to a Git Url and returns a new environment variables object
* @returns a new NodeJS.ProcessEnv object without modifying any input parameters
Expand Down Expand Up @@ -194,7 +184,7 @@ export function getGitEnvironmentVariables(
// construct the Set of allowed hostTypes consisting of the standard Git provides
// plus additionalHostTypes, which are provided as parameter
const gitAllowedHostTypes = new Set<string>([
...standardGitAllowedHostTypes,
...PLATFORM_HOST_TYPES,
...additionalHostTypes,
]);

Expand Down

0 comments on commit 9008c2e

Please sign in to comment.