diff --git a/lib/config/migration.spec.ts b/lib/config/migration.spec.ts
index 462124b8e28b831dedfa0665f120034761aa09cb..4aa9d4625c0db689e1aa100d393f167ddcd03430 100644
--- a/lib/config/migration.spec.ts
+++ b/lib/config/migration.spec.ts
@@ -1,4 +1,4 @@
-import { PLATFORM_TYPE_GITHUB } from '../constants/platforms';
+import { PlatformId } from '../constants';
 import { getConfig } from './defaults';
 import { setGlobalConfig } from './global';
 import * as configMigration from './migration';
@@ -20,7 +20,7 @@ describe('config/migration', () => {
       const config: TestRenovateConfig = {
         endpoints: [{}] as never,
         enabled: true,
-        platform: PLATFORM_TYPE_GITHUB,
+        platform: PlatformId.Github,
         hostRules: [
           {
             platform: 'docker',
diff --git a/lib/config/options/index.ts b/lib/config/options/index.ts
index dc557c23e756fcc9424175969ea4abfaca03d70e..5030ea0a24d2500fb305b71c950e1163ae9a4e55 100644
--- a/lib/config/options/index.ts
+++ b/lib/config/options/index.ts
@@ -1,4 +1,4 @@
-import { PLATFORM_TYPE_GITHUB } from '../../constants/platforms';
+import { PlatformId } from '../../constants';
 import { getManagers } from '../../manager';
 import { getPlatformList } from '../../platform';
 import { getVersioningList } from '../../versioning';
@@ -559,7 +559,7 @@ const options: RenovateOptions[] = [
     description: 'Platform type of repository.',
     type: 'string',
     allowedValues: getPlatformList(),
-    default: PLATFORM_TYPE_GITHUB,
+    default: PlatformId.Github,
     globalOnly: true,
   },
   {
diff --git a/lib/config/presets/local/index.ts b/lib/config/presets/local/index.ts
index 319d513ce58b70e5b8572eb638d43c6231e5a0aa..440197771eb2686eb2b591a1238615c40fec80fb 100644
--- a/lib/config/presets/local/index.ts
+++ b/lib/config/presets/local/index.ts
@@ -1,11 +1,4 @@
-import {
-  PLATFORM_TYPE_AZURE,
-  PLATFORM_TYPE_BITBUCKET,
-  PLATFORM_TYPE_BITBUCKET_SERVER,
-  PLATFORM_TYPE_GITEA,
-  PLATFORM_TYPE_GITHUB,
-  PLATFORM_TYPE_GITLAB,
-} from '../../../constants/platforms';
+import { PlatformId } from '../../../constants';
 import * as azure from '../azure';
 import * as bitbucket from '../bitbucket';
 import * as bitbucketServer from '../bitbucket-server';
@@ -15,12 +8,12 @@ import * as gitlab from '../gitlab';
 import type { Preset, PresetConfig } from '../types';
 
 const resolvers = {
-  [PLATFORM_TYPE_AZURE]: azure,
-  [PLATFORM_TYPE_BITBUCKET]: bitbucket,
-  [PLATFORM_TYPE_BITBUCKET_SERVER]: bitbucketServer,
-  [PLATFORM_TYPE_GITEA]: gitea,
-  [PLATFORM_TYPE_GITHUB]: github,
-  [PLATFORM_TYPE_GITLAB]: gitlab,
+  [PlatformId.Azure]: azure,
+  [PlatformId.Bitbucket]: bitbucket,
+  [PlatformId.BitbucketServer]: bitbucketServer,
+  [PlatformId.Gitea]: gitea,
+  [PlatformId.Github]: github,
+  [PlatformId.Gitlab]: gitlab,
 };
 
 export function getPreset({
diff --git a/lib/constants/index.ts b/lib/constants/index.ts
new file mode 100644
index 0000000000000000000000000000000000000000..fef29321c3b36519a944bf56dd89545896933223
--- /dev/null
+++ b/lib/constants/index.ts
@@ -0,0 +1 @@
+export * from './platforms';
diff --git a/lib/constants/platform.spec.ts b/lib/constants/platform.spec.ts
index 7b2f536b8d3e403769c9395a2c61d124d4f52178..c02a997356c320963927e79d78e7432530c8707c 100644
--- a/lib/constants/platform.spec.ts
+++ b/lib/constants/platform.spec.ts
@@ -7,8 +7,7 @@ import { id as POD_DS } from '../datasource/pod';
 import {
   GITHUB_API_USING_HOST_TYPES,
   GITLAB_API_USING_HOST_TYPES,
-  PLATFORM_TYPE_GITHUB,
-  PLATFORM_TYPE_GITLAB,
+  PlatformId,
 } from './platforms';
 
 describe('constants/platform', () => {
@@ -20,29 +19,21 @@ describe('constants/platform', () => {
     expect(
       GITLAB_API_USING_HOST_TYPES.includes(GitlabPackagesDatasource.id)
     ).toBeTrue();
-    expect(
-      GITLAB_API_USING_HOST_TYPES.includes(PLATFORM_TYPE_GITLAB)
-    ).toBeTrue();
+    expect(GITLAB_API_USING_HOST_TYPES.includes(PlatformId.Gitlab)).toBeTrue();
   });
 
   it('should be not part of the GITLAB_API_USING_HOST_TYPES ', () => {
-    expect(
-      GITLAB_API_USING_HOST_TYPES.includes(PLATFORM_TYPE_GITHUB)
-    ).toBeFalse();
+    expect(GITLAB_API_USING_HOST_TYPES.includes(PlatformId.Github)).toBeFalse();
   });
 
   it('should be part of the GITHUB_API_USING_HOST_TYPES ', () => {
     expect(GITHUB_API_USING_HOST_TYPES.includes(GH_TAGS_DS)).toBeTrue();
     expect(GITHUB_API_USING_HOST_TYPES.includes(GH_RELEASES_DS)).toBeTrue();
     expect(GITHUB_API_USING_HOST_TYPES.includes(POD_DS)).toBeTrue();
-    expect(
-      GITHUB_API_USING_HOST_TYPES.includes(PLATFORM_TYPE_GITHUB)
-    ).toBeTrue();
+    expect(GITHUB_API_USING_HOST_TYPES.includes(PlatformId.Github)).toBeTrue();
   });
 
   it('should be not part of the GITHUB_API_USING_HOST_TYPES ', () => {
-    expect(
-      GITHUB_API_USING_HOST_TYPES.includes(PLATFORM_TYPE_GITLAB)
-    ).toBeFalse();
+    expect(GITHUB_API_USING_HOST_TYPES.includes(PlatformId.Gitlab)).toBeFalse();
   });
 });
diff --git a/lib/constants/platforms.ts b/lib/constants/platforms.ts
index 0bee6d8191f78bb7689752a4bad2fa4dd44036c8..83ce1e763c20ab037a76de477e6f05f1052b04fd 100644
--- a/lib/constants/platforms.ts
+++ b/lib/constants/platforms.ts
@@ -1,19 +1,21 @@
-export const PLATFORM_TYPE_AZURE = 'azure';
-export const PLATFORM_TYPE_BITBUCKET = 'bitbucket';
-export const PLATFORM_TYPE_BITBUCKET_SERVER = 'bitbucket-server';
-export const PLATFORM_TYPE_GITEA = 'gitea';
-export const PLATFORM_TYPE_GITHUB = 'github';
-export const PLATFORM_TYPE_GITLAB = 'gitlab';
+export const enum PlatformId {
+  Azure = 'azure',
+  Bitbucket = 'bitbucket',
+  BitbucketServer = 'bitbucket-server',
+  Gitea = 'gitea',
+  Github = 'github',
+  Gitlab = 'gitlab',
+}
 
 export const GITHUB_API_USING_HOST_TYPES = [
-  PLATFORM_TYPE_GITHUB,
+  PlatformId.Github,
   'github-releases',
   'github-tags',
   'pod',
 ];
 
 export const GITLAB_API_USING_HOST_TYPES = [
-  PLATFORM_TYPE_GITLAB,
+  PlatformId.Gitlab,
   'gitlab-releases',
   'gitlab-tags',
   'gitlab-packages',
diff --git a/lib/datasource/go/index.ts b/lib/datasource/go/index.ts
index 4936c3a721970f6a03aa0a1fe4eb1faf0c73e1ab..42581e7c6dc335e06c44e0554fa6393a681758bf 100644
--- a/lib/datasource/go/index.ts
+++ b/lib/datasource/go/index.ts
@@ -1,5 +1,5 @@
 import URL from 'url';
-import { PLATFORM_TYPE_GITLAB } from '../../constants/platforms';
+import { PlatformId } from '../../constants';
 import { logger } from '../../logger';
 import * as hostRules from '../../util/host-rules';
 import { regEx } from '../../util/regex';
@@ -92,7 +92,7 @@ async function getDatasource(goModule: string): Promise<DataSource | null> {
     }
 
     const opts = hostRules.find({
-      hostType: PLATFORM_TYPE_GITLAB,
+      hostType: PlatformId.Gitlab,
       url: goSourceUrl,
     });
     if (opts.token) {
diff --git a/lib/manager/composer/artifacts.spec.ts b/lib/manager/composer/artifacts.spec.ts
index 0f168ff823842ee2186966155f0b60afd9d062be..42cfe6ea50ad2f4a8a859c4f869b2050cf4925c3 100644
--- a/lib/manager/composer/artifacts.spec.ts
+++ b/lib/manager/composer/artifacts.spec.ts
@@ -3,10 +3,7 @@ import { envMock, exec, mockExecAll } from '../../../test/exec-util';
 import { env, fs, git, mocked, partial } from '../../../test/util';
 import { setGlobalConfig } from '../../config/global';
 import type { RepoGlobalConfig } from '../../config/types';
-import {
-  PLATFORM_TYPE_GITHUB,
-  PLATFORM_TYPE_GITLAB,
-} from '../../constants/platforms';
+import { PlatformId } from '../../constants';
 import * as _datasource from '../../datasource';
 import * as datasourcePackagist from '../../datasource/packagist';
 import * as docker from '../../util/exec/docker';
@@ -97,12 +94,12 @@ describe('manager/composer/artifacts', () => {
 
   it('uses hostRules to set COMPOSER_AUTH', async () => {
     hostRules.add({
-      hostType: PLATFORM_TYPE_GITHUB,
+      hostType: PlatformId.Github,
       matchHost: 'api.github.com',
       token: 'github-token',
     });
     hostRules.add({
-      hostType: PLATFORM_TYPE_GITLAB,
+      hostType: PlatformId.Gitlab,
       matchHost: 'gitlab.com',
       token: 'gitlab-token',
     });
diff --git a/lib/manager/composer/artifacts.ts b/lib/manager/composer/artifacts.ts
index 916cde6b32281a03ed1713690609bf90300b79cd..50862c753bbcd986e80a0be62b6edcce913b62ae 100644
--- a/lib/manager/composer/artifacts.ts
+++ b/lib/manager/composer/artifacts.ts
@@ -1,14 +1,11 @@
 import is from '@sindresorhus/is';
 import { quote } from 'shlex';
 import { getGlobalConfig } from '../../config/global';
+import { PlatformId } from '../../constants';
 import {
   SYSTEM_INSUFFICIENT_DISK_SPACE,
   TEMPORARY_ERROR,
 } from '../../constants/error-messages';
-import {
-  PLATFORM_TYPE_GITHUB,
-  PLATFORM_TYPE_GITLAB,
-} from '../../constants/platforms';
 import * as datasourcePackagist from '../../datasource/packagist';
 import { logger } from '../../logger';
 import { ExecOptions, exec } from '../../util/exec';
@@ -36,7 +33,7 @@ function getAuthJson(): string | null {
   const authJson: AuthJson = {};
 
   const githubCredentials = hostRules.find({
-    hostType: PLATFORM_TYPE_GITHUB,
+    hostType: PlatformId.Github,
     url: 'https://api.github.com/',
   });
   if (githubCredentials?.token) {
@@ -46,7 +43,7 @@ function getAuthJson(): string | null {
   }
 
   hostRules
-    .findAll({ hostType: PLATFORM_TYPE_GITLAB })
+    .findAll({ hostType: PlatformId.Gitlab })
     ?.forEach((gitlabHostRule) => {
       if (gitlabHostRule?.token) {
         const host = gitlabHostRule.resolvedHost || 'gitlab.com';
diff --git a/lib/manager/gomod/artifacts.ts b/lib/manager/gomod/artifacts.ts
index 63faa1101dac486fc412ef0d83a023d0a1542578..a4dc7a33b89141664260849d42ec82ff5ab4f90c 100644
--- a/lib/manager/gomod/artifacts.ts
+++ b/lib/manager/gomod/artifacts.ts
@@ -2,8 +2,8 @@ import is from '@sindresorhus/is';
 import { quote } from 'shlex';
 import { dirname, join } from 'upath';
 import { getGlobalConfig } from '../../config/global';
+import { PlatformId } from '../../constants';
 import { TEMPORARY_ERROR } from '../../constants/error-messages';
-import { PLATFORM_TYPE_GITHUB } from '../../constants/platforms';
 import { logger } from '../../logger';
 import { ExecOptions, exec } from '../../util/exec';
 import { ensureCacheDir, readLocalFile, writeLocalFile } from '../../util/fs';
@@ -19,7 +19,7 @@ import type {
 
 function getPreCommands(): string[] | null {
   const credentials = find({
-    hostType: PLATFORM_TYPE_GITHUB,
+    hostType: PlatformId.Github,
     url: 'https://api.github.com/',
   });
   let preCommands = null;
diff --git a/lib/manager/pre-commit/extract.ts b/lib/manager/pre-commit/extract.ts
index 2708d1ddd86e2f56f855e9ab1c9994e019e614c2..aef244b22b20cfc3c51eef77e3d84cea11026f97 100644
--- a/lib/manager/pre-commit/extract.ts
+++ b/lib/manager/pre-commit/extract.ts
@@ -1,10 +1,6 @@
 import is from '@sindresorhus/is';
 import { load } from 'js-yaml';
-import {
-  PLATFORM_TYPE_GITEA,
-  PLATFORM_TYPE_GITHUB,
-  PLATFORM_TYPE_GITLAB,
-} from '../../constants/platforms';
+import { PlatformId } from '../../constants';
 import { id as githubTagsId } from '../../datasource/github-tags';
 import { id as gitlabTagsId } from '../../datasource/gitlab-tags';
 import { logger } from '../../logger';
@@ -55,9 +51,9 @@ function determineDatasource(
     return { skipReason: SkipReason.UnknownRegistry, registryUrls: [hostname] };
   }
   for (const [hostType, sourceId] of [
-    [PLATFORM_TYPE_GITEA, gitlabTagsId],
-    [PLATFORM_TYPE_GITHUB, githubTagsId],
-    [PLATFORM_TYPE_GITLAB, gitlabTagsId],
+    [PlatformId.Gitea, gitlabTagsId],
+    [PlatformId.Github, githubTagsId],
+    [PlatformId.Gitlab, gitlabTagsId],
   ]) {
     if (!isEmptyObject(find({ hostType, url: hostUrl }))) {
       logger.debug(
diff --git a/lib/platform/azure/azure-got-wrapper.spec.ts b/lib/platform/azure/azure-got-wrapper.spec.ts
index 1907cb3285faf9b0eca25c33d507328ec011c142..bf7e14a4eb5c047be9edd8c92e917395afd25e30 100644
--- a/lib/platform/azure/azure-got-wrapper.spec.ts
+++ b/lib/platform/azure/azure-got-wrapper.spec.ts
@@ -1,4 +1,4 @@
-import { PLATFORM_TYPE_AZURE } from '../../constants/platforms';
+import { PlatformId } from '../../constants';
 import * as _hostRules from '../../util/host-rules';
 
 describe('platform/azure/azure-got-wrapper', () => {
@@ -19,7 +19,7 @@ describe('platform/azure/azure-got-wrapper', () => {
     });
     it('should set personal access token and endpoint', () => {
       hostRules.add({
-        hostType: PLATFORM_TYPE_AZURE,
+        hostType: PlatformId.Azure,
         token: '123test',
         matchHost: 'https://dev.azure.com/renovate1',
       });
@@ -35,7 +35,7 @@ describe('platform/azure/azure-got-wrapper', () => {
     });
     it('should set bearer token and endpoint', () => {
       hostRules.add({
-        hostType: PLATFORM_TYPE_AZURE,
+        hostType: PlatformId.Azure,
         token: 'testtoken',
         matchHost: 'https://dev.azure.com/renovate2',
       });
@@ -52,7 +52,7 @@ describe('platform/azure/azure-got-wrapper', () => {
 
     it('should set password and endpoint', () => {
       hostRules.add({
-        hostType: PLATFORM_TYPE_AZURE,
+        hostType: PlatformId.Azure,
         username: 'user',
         password: 'pass',
         matchHost: 'https://dev.azure.com/renovate3',
diff --git a/lib/platform/azure/azure-got-wrapper.ts b/lib/platform/azure/azure-got-wrapper.ts
index 9b1c6c76aed3ed64e98e4e90a8e1d6ec65d80409..e0f06a0ccaf8eec3fa306031c606538cfa8755cb 100644
--- a/lib/platform/azure/azure-got-wrapper.ts
+++ b/lib/platform/azure/azure-got-wrapper.ts
@@ -4,11 +4,11 @@ import { ICoreApi } from 'azure-devops-node-api/CoreApi';
 import { IGitApi } from 'azure-devops-node-api/GitApi';
 import { IPolicyApi } from 'azure-devops-node-api/PolicyApi';
 import { IRequestHandler } from 'azure-devops-node-api/interfaces/common/VsoBaseInterfaces';
-import { PLATFORM_TYPE_AZURE } from '../../constants/platforms';
+import { PlatformId } from '../../constants';
 import { HostRule } from '../../types';
 import * as hostRules from '../../util/host-rules';
 
-const hostType = PLATFORM_TYPE_AZURE;
+const hostType = PlatformId.Azure;
 let endpoint: string;
 
 function getAuthenticationHandler(config: HostRule): IRequestHandler {
diff --git a/lib/platform/azure/index.ts b/lib/platform/azure/index.ts
index a280295d6262bf5a56a3403730aea11fac25b8a8..9d19e3d2ef283b11690dc83efd60e3c55ff1895d 100644
--- a/lib/platform/azure/index.ts
+++ b/lib/platform/azure/index.ts
@@ -8,8 +8,8 @@ import {
   PullRequestStatus,
 } from 'azure-devops-node-api/interfaces/GitInterfaces';
 import delay from 'delay';
+import { PlatformId } from '../../constants';
 import { REPOSITORY_EMPTY } from '../../constants/error-messages';
-import { PLATFORM_TYPE_AZURE } from '../../constants/platforms';
 import { logger } from '../../logger';
 import { BranchStatus, PrState, VulnerabilityAlert } from '../../types';
 import * as git from '../../util/git';
@@ -73,7 +73,7 @@ const defaults: {
   endpoint?: string;
   hostType: string;
 } = {
-  hostType: PLATFORM_TYPE_AZURE,
+  hostType: PlatformId.Azure,
 };
 
 export function initPlatform({
diff --git a/lib/platform/bitbucket-server/index.ts b/lib/platform/bitbucket-server/index.ts
index 2bc866b66464fda25d70c1e8695169fecb7b629e..d88faecdf32dfe8d93af19a0f53935f2055289b7 100644
--- a/lib/platform/bitbucket-server/index.ts
+++ b/lib/platform/bitbucket-server/index.ts
@@ -2,12 +2,12 @@ import url from 'url';
 import is from '@sindresorhus/is';
 import delay from 'delay';
 import type { PartialDeep } from 'type-fest';
+import { PlatformId } from '../../constants';
 import {
   REPOSITORY_CHANGED,
   REPOSITORY_EMPTY,
   REPOSITORY_NOT_FOUND,
 } from '../../constants/error-messages';
-import { PLATFORM_TYPE_BITBUCKET_SERVER } from '../../constants/platforms';
 import { logger } from '../../logger';
 import { BranchStatus, PrState, VulnerabilityAlert } from '../../types';
 import { GitProtocol } from '../../types/git';
@@ -68,7 +68,7 @@ const defaults: {
   endpoint?: string;
   hostType: string;
 } = {
-  hostType: PLATFORM_TYPE_BITBUCKET_SERVER,
+  hostType: PlatformId.BitbucketServer,
 };
 
 /* istanbul ignore next */
diff --git a/lib/platform/bitbucket/index.ts b/lib/platform/bitbucket/index.ts
index d9df2f0870e30feb908f60df9dff5fc8c49c83c4..04ff05b3cd90de0c2f601fd1df583784697e8739 100644
--- a/lib/platform/bitbucket/index.ts
+++ b/lib/platform/bitbucket/index.ts
@@ -1,8 +1,8 @@
 import URL from 'url';
 import is from '@sindresorhus/is';
 import parseDiff from 'parse-diff';
+import { PlatformId } from '../../constants';
 import { REPOSITORY_NOT_FOUND } from '../../constants/error-messages';
-import { PLATFORM_TYPE_BITBUCKET } from '../../constants/platforms';
 import { logger } from '../../logger';
 import { BranchStatus, PrState, VulnerabilityAlert } from '../../types';
 import * as git from '../../util/git';
@@ -127,7 +127,7 @@ export async function initRepo({
 }: RepoParams): Promise<RepoResult> {
   logger.debug(`initRepo("${repository}")`);
   const opts = hostRules.find({
-    hostType: PLATFORM_TYPE_BITBUCKET,
+    hostType: PlatformId.Bitbucket,
     url: defaults.endpoint,
   });
   config = {
diff --git a/lib/platform/gitea/index.ts b/lib/platform/gitea/index.ts
index c6f34b19bd1c19f1a38f9c2526ec8234b98906c9..fa055a6ce78e486600ca29a04c63b2e493bfb945 100644
--- a/lib/platform/gitea/index.ts
+++ b/lib/platform/gitea/index.ts
@@ -1,6 +1,7 @@
 import URL from 'url';
 import is from '@sindresorhus/is';
 import { lt } from 'semver';
+import { PlatformId } from '../../constants';
 import {
   REPOSITORY_ACCESS_FORBIDDEN,
   REPOSITORY_ARCHIVED,
@@ -9,7 +10,6 @@ import {
   REPOSITORY_EMPTY,
   REPOSITORY_MIRRORED,
 } from '../../constants/error-messages';
-import { PLATFORM_TYPE_GITEA } from '../../constants/platforms';
 import { logger } from '../../logger';
 import { BranchStatus, PrState, VulnerabilityAlert } from '../../types';
 import * as git from '../../util/git';
@@ -50,7 +50,7 @@ interface GiteaRepoConfig {
 }
 
 const defaults = {
-  hostType: PLATFORM_TYPE_GITEA,
+  hostType: PlatformId.Gitea,
   endpoint: 'https://gitea.com/api/v1/',
   version: '0.0.0',
 };
@@ -287,7 +287,7 @@ const platform: Platform = {
 
     // Find options for current host and determine Git endpoint
     const opts = hostRules.find({
-      hostType: PLATFORM_TYPE_GITEA,
+      hostType: PlatformId.Gitea,
       url: defaults.endpoint,
     });
     const gitEndpoint = URL.parse(repo.clone_url);
diff --git a/lib/platform/github/index.ts b/lib/platform/github/index.ts
index bc76286e56fb654150eb33983e426c248599f6d8..04b4c146d7d37cde8e06a05e1b4d2169727ea04b 100644
--- a/lib/platform/github/index.ts
+++ b/lib/platform/github/index.ts
@@ -2,6 +2,7 @@ import URL from 'url';
 import is from '@sindresorhus/is';
 import delay from 'delay';
 import { DateTime } from 'luxon';
+import { PlatformId } from '../../constants';
 import {
   PLATFORM_INTEGRATION_UNAUTHORIZED,
   REPOSITORY_ACCESS_FORBIDDEN,
@@ -15,7 +16,6 @@ import {
   REPOSITORY_NOT_FOUND,
   REPOSITORY_RENAMED,
 } from '../../constants/error-messages';
-import { PLATFORM_TYPE_GITHUB } from '../../constants/platforms';
 import { logger } from '../../logger';
 import { BranchStatus, PrState, VulnerabilityAlert } from '../../types';
 import { ExternalHostError } from '../../types/errors/external-host-error';
@@ -69,7 +69,7 @@ const githubApi = new githubHttp.GithubHttp();
 let config: LocalRepoConfig = {} as any;
 
 const defaults = {
-  hostType: PLATFORM_TYPE_GITHUB,
+  hostType: PlatformId.Github,
   endpoint: 'https://api.github.com/',
 };
 
@@ -188,7 +188,7 @@ export async function initRepo({
     githubHttp.setBaseUrl(endpoint);
   }
   const opts = hostRules.find({
-    hostType: PLATFORM_TYPE_GITHUB,
+    hostType: PlatformId.Github,
     url: defaults.endpoint,
   });
   config.isGhe = URL.parse(defaults.endpoint).host !== 'api.github.com';
@@ -665,7 +665,7 @@ export async function getPrList(): Promise<Pr[]> {
       ).body;
     } catch (err) /* istanbul ignore next */ {
       logger.debug({ err }, 'getPrList err');
-      throw new ExternalHostError(err, PLATFORM_TYPE_GITHUB);
+      throw new ExternalHostError(err, PlatformId.Github);
     }
     config.prList = prList
       .filter(
@@ -1275,7 +1275,7 @@ async function getComments(issueNo: number): Promise<Comment[]> {
   } catch (err) /* istanbul ignore next */ {
     if (err.statusCode === 404) {
       logger.debug('404 response when retrieving comments');
-      throw new ExternalHostError(err, PLATFORM_TYPE_GITHUB);
+      throw new ExternalHostError(err, PlatformId.Github);
     }
     throw err;
   }
diff --git a/lib/platform/gitlab/index.ts b/lib/platform/gitlab/index.ts
index 236bc5f85953858b6fe8c2224e13c97fb83c735b..25ba11b2a0a9b24e245aef5f6f11b207d6f2f990 100644
--- a/lib/platform/gitlab/index.ts
+++ b/lib/platform/gitlab/index.ts
@@ -3,6 +3,7 @@ import is from '@sindresorhus/is';
 import delay from 'delay';
 import pAll from 'p-all';
 import { lt } from 'semver';
+import { PlatformId } from '../../constants';
 import {
   CONFIG_GIT_URL_UNAVAILABLE,
   PLATFORM_AUTHENTICATION_ERROR,
@@ -15,7 +16,6 @@ import {
   REPOSITORY_NOT_FOUND,
   TEMPORARY_ERROR,
 } from '../../constants/error-messages';
-import { PLATFORM_TYPE_GITLAB } from '../../constants/platforms';
 import { logger } from '../../logger';
 import { BranchStatus, PrState, VulnerabilityAlert } from '../../types';
 import * as git from '../../util/git';
@@ -66,7 +66,7 @@ let config: {
 } = {} as any;
 
 const defaults = {
-  hostType: PLATFORM_TYPE_GITLAB,
+  hostType: PlatformId.Gitlab,
   endpoint: 'https://gitlab.com/api/v4/',
   version: '0.0.0',
 };
diff --git a/lib/platform/index.spec.ts b/lib/platform/index.spec.ts
index 1a29be4909fd66ede097adcbab888a0cbe3faeee..082622207698756be41fd2d7058d8445c84cb16a 100644
--- a/lib/platform/index.spec.ts
+++ b/lib/platform/index.spec.ts
@@ -1,6 +1,6 @@
 import * as httpMock from '../../test/http-mock';
+import { PlatformId } from '../constants';
 import { PLATFORM_NOT_FOUND } from '../constants/error-messages';
-import { PLATFORM_TYPE_BITBUCKET } from '../constants/platforms';
 import { loadModules } from '../util/modules';
 import type { Platform } from './types';
 import * as platform from '.';
@@ -51,7 +51,7 @@ describe('platform/index', () => {
       .basicAuth({ user: 'abc', pass: '123' })
       .reply(200, { uuid: 123 });
     const config = {
-      platform: PLATFORM_TYPE_BITBUCKET,
+      platform: PlatformId.Bitbucket,
       gitAuthor: 'user@domain.com',
       username: 'abc',
       password: '123',
@@ -67,7 +67,7 @@ describe('platform/index', () => {
           username: 'abc',
         },
       ],
-      platform: PLATFORM_TYPE_BITBUCKET,
+      platform: PlatformId.Bitbucket,
     });
   });
 });
diff --git a/lib/util/host-rules.spec.ts b/lib/util/host-rules.spec.ts
index 7bc63e902dde7dfa351e3e83787d2f5ced274a3c..04c965b43d5f3ed24b46b7543f45ca46dfab5bc2 100644
--- a/lib/util/host-rules.spec.ts
+++ b/lib/util/host-rules.spec.ts
@@ -1,7 +1,4 @@
-import {
-  PLATFORM_TYPE_AZURE,
-  PLATFORM_TYPE_GITHUB,
-} from '../constants/platforms';
+import { PlatformId } from '../constants';
 import * as datasourceNuget from '../datasource/nuget';
 import { add, clear, find, findAll, hosts } from './host-rules';
 
@@ -13,7 +10,7 @@ describe('util/host-rules', () => {
     it('throws if both domainName and hostName', () => {
       expect(() =>
         add({
-          hostType: PLATFORM_TYPE_AZURE,
+          hostType: PlatformId.Azure,
           domainName: 'github.com',
           hostName: 'api.github.com',
         } as any)
@@ -22,7 +19,7 @@ describe('util/host-rules', () => {
     it('throws if both domainName and baseUrl', () => {
       expect(() =>
         add({
-          hostType: PLATFORM_TYPE_AZURE,
+          hostType: PlatformId.Azure,
           domainName: 'github.com',
           matchHost: 'https://api.github.com',
         } as any)
@@ -31,7 +28,7 @@ describe('util/host-rules', () => {
     it('throws if both hostName and baseUrl', () => {
       expect(() =>
         add({
-          hostType: PLATFORM_TYPE_AZURE,
+          hostType: PlatformId.Azure,
           hostName: 'api.github.com',
           matchHost: 'https://api.github.com',
         } as any)
@@ -113,25 +110,25 @@ describe('util/host-rules', () => {
     it('matches on specific path', () => {
       // Initialized platform holst rule
       add({
-        hostType: PLATFORM_TYPE_GITHUB,
+        hostType: PlatformId.Github,
         matchHost: 'https://api.github.com',
         token: 'abc',
       });
       // Initialized generic host rule for github platform
       add({
-        hostType: PLATFORM_TYPE_GITHUB,
+        hostType: PlatformId.Github,
         matchHost: 'https://api.github.com',
         token: 'abc',
       });
       // specific host rule for using other token in different org
       add({
-        hostType: PLATFORM_TYPE_GITHUB,
+        hostType: PlatformId.Github,
         matchHost: 'https://api.github.com/repos/org-b/',
         token: 'def',
       });
       expect(
         find({
-          hostType: PLATFORM_TYPE_GITHUB,
+          hostType: PlatformId.Github,
           url: 'https://api.github.com/repos/org-b/someRepo/tags?per_page=100',
         }).token
       ).toEqual('def');
@@ -144,7 +141,7 @@ describe('util/host-rules', () => {
       });
       expect(
         find({
-          hostType: PLATFORM_TYPE_GITHUB,
+          hostType: PlatformId.Github,
           url: 'https://api.github.com/repos/org-b/someRepo/tags?per_page=100',
         }).token
       ).toEqual('abc');
@@ -158,7 +155,7 @@ describe('util/host-rules', () => {
 
     it('matches if hostType is configured and host rule is filtered with datasource', () => {
       add({
-        hostType: PLATFORM_TYPE_GITHUB,
+        hostType: PlatformId.Github,
         matchHost: 'https://api.github.com',
         token: 'abc',
       });
diff --git a/lib/util/http/auth.spec.ts b/lib/util/http/auth.spec.ts
index 8737d084b259334c76795ad1d45c24e06f0cc989..72da33c84b21fc2986212e78ce2c04f7d2cc5ae7 100644
--- a/lib/util/http/auth.spec.ts
+++ b/lib/util/http/auth.spec.ts
@@ -1,10 +1,6 @@
 import { NormalizedOptions } from 'got';
 import { partial } from '../../../test/util';
-import {
-  PLATFORM_TYPE_GITEA,
-  PLATFORM_TYPE_GITHUB,
-  PLATFORM_TYPE_GITLAB,
-} from '../../constants/platforms';
+import { PlatformId } from '../../constants';
 import { applyAuthorization, removeAuthorization } from './auth';
 import { GotOptions } from './types';
 
@@ -33,7 +29,7 @@ describe('util/http/auth', () => {
     it('gitea password', () => {
       const opts: GotOptions = {
         headers: {},
-        hostType: PLATFORM_TYPE_GITEA,
+        hostType: PlatformId.Gitea,
         password: 'XXXX',
       };
 
@@ -54,7 +50,7 @@ describe('util/http/auth', () => {
       const opts: GotOptions = {
         headers: {},
         token: 'XXXX',
-        hostType: PLATFORM_TYPE_GITEA,
+        hostType: PlatformId.Gitea,
       };
 
       applyAuthorization(opts);
@@ -74,7 +70,7 @@ describe('util/http/auth', () => {
       const opts: GotOptions = {
         headers: {},
         token: 'XXX',
-        hostType: PLATFORM_TYPE_GITHUB,
+        hostType: PlatformId.Github,
       };
 
       applyAuthorization(opts);
@@ -112,7 +108,7 @@ describe('util/http/auth', () => {
         headers: {},
         // Personal Access Token is exactly 20 characters long
         token: '0123456789012345test',
-        hostType: PLATFORM_TYPE_GITLAB,
+        hostType: PlatformId.Gitlab,
       };
 
       applyAuthorization(opts);
@@ -133,7 +129,7 @@ describe('util/http/auth', () => {
         headers: {},
         token:
           'a40bdd925a0c0b9c4cdd19d101c0df3b2bcd063ab7ad6706f03bcffcec01test',
-        hostType: PLATFORM_TYPE_GITLAB,
+        hostType: PlatformId.Gitlab,
       };
 
       applyAuthorization(opts);
diff --git a/lib/util/http/auth.ts b/lib/util/http/auth.ts
index a8dfc3f42f4448d4c1bcd4f551eddeddc41374a8..59dba806f715643a4801eaa5474c67c13f42195e 100644
--- a/lib/util/http/auth.ts
+++ b/lib/util/http/auth.ts
@@ -3,8 +3,8 @@ import type { NormalizedOptions } from 'got';
 import {
   GITHUB_API_USING_HOST_TYPES,
   GITLAB_API_USING_HOST_TYPES,
-  PLATFORM_TYPE_GITEA,
-} from '../../constants/platforms';
+  PlatformId,
+} from '../../constants';
 import type { GotOptions } from './types';
 
 export function applyAuthorization(inOptions: GotOptions): GotOptions {
@@ -15,7 +15,7 @@ export function applyAuthorization(inOptions: GotOptions): GotOptions {
   }
 
   if (options.token) {
-    if (options.hostType === PLATFORM_TYPE_GITEA) {
+    if (options.hostType === PlatformId.Gitea) {
       options.headers.authorization = `token ${options.token}`;
     } else if (GITHUB_API_USING_HOST_TYPES.includes(options.hostType)) {
       options.headers.authorization = `token ${options.token}`;
diff --git a/lib/util/http/bitbucket-server.spec.ts b/lib/util/http/bitbucket-server.spec.ts
index 65cf77d7d607ae722e6ea34627c85ebca5e17a51..a1608178e7e833e49ecabd1a0c6a6ce64934e205 100644
--- a/lib/util/http/bitbucket-server.spec.ts
+++ b/lib/util/http/bitbucket-server.spec.ts
@@ -1,5 +1,5 @@
 import * as httpMock from '../../../test/http-mock';
-import { PLATFORM_TYPE_BITBUCKET_SERVER } from '../../constants/platforms';
+import { PlatformId } from '../../constants';
 import * as hostRules from '../host-rules';
 import { BitbucketServerHttp, setBaseUrl } from './bitbucket-server';
 
@@ -16,7 +16,7 @@ describe('util/http/bitbucket-server', () => {
     // clean up hostRules
     hostRules.clear();
     hostRules.add({
-      hostType: PLATFORM_TYPE_BITBUCKET_SERVER,
+      hostType: PlatformId.BitbucketServer,
       matchHost: baseUrl,
       token: 'token',
     });
diff --git a/lib/util/http/bitbucket-server.ts b/lib/util/http/bitbucket-server.ts
index dd96385b99d0b1a46988c3f4e31ba98abf2bb764..6d2d91aa3e96a7e8b3261a388fc6728afb16e7f2 100644
--- a/lib/util/http/bitbucket-server.ts
+++ b/lib/util/http/bitbucket-server.ts
@@ -1,4 +1,4 @@
-import { PLATFORM_TYPE_BITBUCKET_SERVER } from '../../constants/platforms';
+import { PlatformId } from '../../constants';
 import { resolveBaseUrl } from '../url';
 import { Http, HttpOptions, HttpResponse, InternalHttpOptions } from '.';
 
@@ -9,7 +9,7 @@ export const setBaseUrl = (url: string): void => {
 
 export class BitbucketServerHttp extends Http {
   constructor(options?: HttpOptions) {
-    super(PLATFORM_TYPE_BITBUCKET_SERVER, options);
+    super(PlatformId.BitbucketServer, options);
   }
 
   protected override request<T>(
diff --git a/lib/util/http/bitbucket.spec.ts b/lib/util/http/bitbucket.spec.ts
index ace4b8a50c755a03aa7c07550397b0867957008c..ae38ead34ebdda23923c1cb595cbb364512494f4 100644
--- a/lib/util/http/bitbucket.spec.ts
+++ b/lib/util/http/bitbucket.spec.ts
@@ -1,5 +1,5 @@
 import * as httpMock from '../../../test/http-mock';
-import { PLATFORM_TYPE_BITBUCKET } from '../../constants/platforms';
+import { PlatformId } from '../../constants';
 import * as hostRules from '../host-rules';
 import { BitbucketHttp, setBaseUrl } from './bitbucket';
 
@@ -16,7 +16,7 @@ describe('util/http/bitbucket', () => {
     // clean up hostRules
     hostRules.clear();
     hostRules.add({
-      hostType: PLATFORM_TYPE_BITBUCKET,
+      hostType: PlatformId.Bitbucket,
       matchHost: baseUrl,
       token: 'token',
     });
diff --git a/lib/util/http/bitbucket.ts b/lib/util/http/bitbucket.ts
index 10f56e4a25664caed058a7d785ad7cc8942a785f..1eaaab9e531d3ee91db35b1d5e51b6a46a7afd39 100644
--- a/lib/util/http/bitbucket.ts
+++ b/lib/util/http/bitbucket.ts
@@ -1,4 +1,4 @@
-import { PLATFORM_TYPE_BITBUCKET } from '../../constants/platforms';
+import { PlatformId } from '../../constants';
 import { Http, HttpOptions, HttpResponse, InternalHttpOptions } from '.';
 
 let baseUrl = 'https://api.bitbucket.org/';
@@ -9,7 +9,7 @@ export const setBaseUrl = (url: string): void => {
 
 export class BitbucketHttp extends Http {
   constructor(options?: HttpOptions) {
-    super(PLATFORM_TYPE_BITBUCKET, options);
+    super(PlatformId.Bitbucket, options);
   }
 
   protected override request<T>(
diff --git a/lib/util/http/gitea.ts b/lib/util/http/gitea.ts
index 5410284e3852eb1b0b0553815e39d68804f983a7..ff53983fc856d72d166f0e7503452891f36186dd 100644
--- a/lib/util/http/gitea.ts
+++ b/lib/util/http/gitea.ts
@@ -1,4 +1,4 @@
-import { PLATFORM_TYPE_GITEA } from '../../constants/platforms';
+import { PlatformId } from '../../constants';
 import { resolveBaseUrl } from '../url';
 import { Http, HttpOptions, HttpResponse, InternalHttpOptions } from '.';
 
@@ -30,7 +30,7 @@ function resolveUrl(path: string, base: string): URL {
 
 export class GiteaHttp extends Http<GiteaHttpOptions, GiteaHttpOptions> {
   constructor(options?: HttpOptions) {
-    super(PLATFORM_TYPE_GITEA, options);
+    super(PlatformId.Gitea, options);
   }
 
   protected override async request<T>(
diff --git a/lib/util/http/github.ts b/lib/util/http/github.ts
index 478c72f54f1233f0748e901d116efc9f10d98cb4..e555fed631089165b046f0f247c7a1f5670f1c2d 100644
--- a/lib/util/http/github.ts
+++ b/lib/util/http/github.ts
@@ -1,13 +1,13 @@
 import is from '@sindresorhus/is';
 import pAll from 'p-all';
 import parseLinkHeader from 'parse-link-header';
+import { PlatformId } from '../../constants';
 import {
   PLATFORM_BAD_CREDENTIALS,
   PLATFORM_INTEGRATION_UNAUTHORIZED,
   PLATFORM_RATE_LIMIT_EXCEEDED,
   REPOSITORY_CHANGED,
 } from '../../constants/error-messages';
-import { PLATFORM_TYPE_GITHUB } from '../../constants/platforms';
 import { logger } from '../../logger';
 import { ExternalHostError } from '../../types/errors/external-host-error';
 import { maskToken } from '../mask';
@@ -55,15 +55,15 @@ function handleGotError(
       err.code === 'ECONNRESET')
   ) {
     logger.debug({ err }, 'GitHub failure: RequestError');
-    throw new ExternalHostError(err, PLATFORM_TYPE_GITHUB);
+    throw new ExternalHostError(err, PlatformId.Github);
   }
   if (err.name === 'ParseError') {
     logger.debug({ err }, '');
-    throw new ExternalHostError(err, PLATFORM_TYPE_GITHUB);
+    throw new ExternalHostError(err, PlatformId.Github);
   }
   if (err.statusCode >= 500 && err.statusCode < 600) {
     logger.debug({ err }, 'GitHub failure: 5xx');
-    throw new ExternalHostError(err, PLATFORM_TYPE_GITHUB);
+    throw new ExternalHostError(err, PlatformId.Github);
   }
   if (
     err.statusCode === 403 &&
@@ -100,7 +100,7 @@ function handleGotError(
       'GitHub failure: Bad credentials'
     );
     if (rateLimit === '60') {
-      throw new ExternalHostError(err, PLATFORM_TYPE_GITHUB);
+      throw new ExternalHostError(err, PlatformId.Github);
     }
     throw new Error(PLATFORM_BAD_CREDENTIALS);
   }
@@ -120,7 +120,7 @@ function handleGotError(
       throw err;
     }
     logger.debug({ err }, '422 Error thrown from GitHub');
-    throw new ExternalHostError(err, PLATFORM_TYPE_GITHUB);
+    throw new ExternalHostError(err, PlatformId.Github);
   }
   if (
     err.statusCode === 410 &&
@@ -159,7 +159,7 @@ function constructAcceptString(input?: any): string {
 
 export class GithubHttp extends Http<GithubHttpOptions, GithubHttpOptions> {
   constructor(
-    hostType: string = PLATFORM_TYPE_GITHUB,
+    hostType: string = PlatformId.Github,
     options?: GithubHttpOptions
   ) {
     super(hostType, options);
diff --git a/lib/util/http/gitlab.spec.ts b/lib/util/http/gitlab.spec.ts
index 103640c7b078b2813938039cb6c8cff5ad2865cf..729ac29c28dacc9fcfd13b76c2e9d54118762757 100644
--- a/lib/util/http/gitlab.spec.ts
+++ b/lib/util/http/gitlab.spec.ts
@@ -1,12 +1,12 @@
 import * as httpMock from '../../../test/http-mock';
+import { PlatformId } from '../../constants';
 import { EXTERNAL_HOST_ERROR } from '../../constants/error-messages';
-import { PLATFORM_TYPE_GITLAB } from '../../constants/platforms';
 import { GitlabReleasesDatasource } from '../../datasource/gitlab-releases';
 import * as hostRules from '../host-rules';
 import { GitlabHttp, setBaseUrl } from './gitlab';
 
 hostRules.add({
-  hostType: PLATFORM_TYPE_GITLAB,
+  hostType: PlatformId.Gitlab,
   token: '123test',
 });
 
@@ -22,7 +22,7 @@ describe('util/http/gitlab', () => {
     delete process.env.GITLAB_IGNORE_REPO_URL;
 
     hostRules.add({
-      hostType: PLATFORM_TYPE_GITLAB,
+      hostType: PlatformId.Gitlab,
       token: 'abc123',
     });
   });
@@ -79,7 +79,7 @@ describe('util/http/gitlab', () => {
 
   it('supports different datasources', async () => {
     const gitlabApiDatasource = new GitlabHttp(GitlabReleasesDatasource.id);
-    hostRules.add({ hostType: PLATFORM_TYPE_GITLAB, token: 'abc' });
+    hostRules.add({ hostType: PlatformId.Gitlab, token: 'abc' });
     hostRules.add({
       hostType: GitlabReleasesDatasource.id,
       token: 'def',
diff --git a/lib/util/http/gitlab.ts b/lib/util/http/gitlab.ts
index 18eacdd2240f81e1f1132af1225866ea6cac87e7..7c6589ce98aa50b4dfb5b5dcb5a28cbba115e3c1 100644
--- a/lib/util/http/gitlab.ts
+++ b/lib/util/http/gitlab.ts
@@ -1,5 +1,5 @@
 import parseLinkHeader from 'parse-link-header';
-import { PLATFORM_TYPE_GITLAB } from '../../constants/platforms';
+import { PlatformId } from '../../constants';
 import { logger } from '../../logger';
 import { ExternalHostError } from '../../types/errors/external-host-error';
 import { parseUrl } from '../url';
@@ -20,10 +20,7 @@ export interface GitlabHttpOptions extends InternalHttpOptions {
 }
 
 export class GitlabHttp extends Http<GitlabHttpOptions, GitlabHttpOptions> {
-  constructor(
-    type: string = PLATFORM_TYPE_GITLAB,
-    options?: GitlabHttpOptions
-  ) {
+  constructor(type: string = PlatformId.Gitlab, options?: GitlabHttpOptions) {
     super(type, options);
   }
 
@@ -73,7 +70,7 @@ export class GitlabHttp extends Http<GitlabHttpOptions, GitlabHttpOptions> {
         err.statusCode === 429 ||
         (err.statusCode >= 500 && err.statusCode < 600)
       ) {
-        throw new ExternalHostError(err, PLATFORM_TYPE_GITLAB);
+        throw new ExternalHostError(err, PlatformId.Gitlab);
       }
       const platformFailureCodes = [
         'EAI_AGAIN',
@@ -82,10 +79,10 @@ export class GitlabHttp extends Http<GitlabHttpOptions, GitlabHttpOptions> {
         'UNABLE_TO_VERIFY_LEAF_SIGNATURE',
       ];
       if (platformFailureCodes.includes(err.code)) {
-        throw new ExternalHostError(err, PLATFORM_TYPE_GITLAB);
+        throw new ExternalHostError(err, PlatformId.Gitlab);
       }
       if (err.name === 'ParseError') {
-        throw new ExternalHostError(err, PLATFORM_TYPE_GITLAB);
+        throw new ExternalHostError(err, PlatformId.Gitlab);
       }
       throw err;
     }
diff --git a/lib/util/http/host-rules.spec.ts b/lib/util/http/host-rules.spec.ts
index b4c8ebfd944c5011c0a9e46f8b7abcccc28568f2..00e04a386ee76c2640928d3cbad572c17ee645cc 100644
--- a/lib/util/http/host-rules.spec.ts
+++ b/lib/util/http/host-rules.spec.ts
@@ -1,8 +1,4 @@
-import {
-  PLATFORM_TYPE_GITEA,
-  PLATFORM_TYPE_GITHUB,
-  PLATFORM_TYPE_GITLAB,
-} from '../../constants/platforms';
+import { PlatformId } from '../../constants';
 import { bootstrap } from '../../proxy';
 import * as hostRules from '../host-rules';
 import { applyHostRules } from './host-rules';
@@ -13,7 +9,7 @@ jest.mock('global-agent');
 
 describe('util/http/host-rules', () => {
   const options = {
-    hostType: PLATFORM_TYPE_GITHUB,
+    hostType: PlatformId.Github,
   };
   beforeEach(() => {
     // reset module
@@ -24,11 +20,11 @@ describe('util/http/host-rules', () => {
     // clean up hostRules
     hostRules.clear();
     hostRules.add({
-      hostType: PLATFORM_TYPE_GITHUB,
+      hostType: PlatformId.Github,
       token: 'token',
     });
     hostRules.add({
-      hostType: PLATFORM_TYPE_GITEA,
+      hostType: PlatformId.Gitea,
       password: 'password',
     });
 
@@ -39,7 +35,7 @@ describe('util/http/host-rules', () => {
     });
 
     hostRules.add({
-      hostType: PLATFORM_TYPE_GITLAB,
+      hostType: PlatformId.Gitlab,
       token: 'abc',
     });
 
@@ -67,7 +63,7 @@ describe('util/http/host-rules', () => {
   });
 
   it('adds auth', () => {
-    expect(applyHostRules(url, { hostType: PLATFORM_TYPE_GITEA }))
+    expect(applyHostRules(url, { hostType: PlatformId.Gitea }))
       .toMatchInlineSnapshot(`
       Object {
         "hostType": "gitea",
diff --git a/lib/util/http/host-rules.ts b/lib/util/http/host-rules.ts
index 86537e4ea12c17e1867a946449d0f35b24db5132..4d86c913d6521940e8f658d8ac522ddd77d790eb 100644
--- a/lib/util/http/host-rules.ts
+++ b/lib/util/http/host-rules.ts
@@ -1,9 +1,8 @@
 import {
   GITHUB_API_USING_HOST_TYPES,
   GITLAB_API_USING_HOST_TYPES,
-  PLATFORM_TYPE_GITHUB,
-  PLATFORM_TYPE_GITLAB,
-} from '../../constants/platforms';
+  PlatformId,
+} from '../../constants';
 import { logger } from '../../logger';
 import { hasProxy } from '../../proxy';
 import type { HostRule } from '../../types';
@@ -22,11 +21,11 @@ function findMatchingRules(options: GotOptions, url: string): HostRule {
   // Fallback to `github` hostType
   if (
     GITHUB_API_USING_HOST_TYPES.includes(hostType) &&
-    hostType !== PLATFORM_TYPE_GITHUB
+    hostType !== PlatformId.Github
   ) {
     res = {
       ...hostRules.find({
-        hostType: PLATFORM_TYPE_GITHUB,
+        hostType: PlatformId.Github,
         url,
       }),
       ...res,
@@ -36,11 +35,11 @@ function findMatchingRules(options: GotOptions, url: string): HostRule {
   // Fallback to `gitlab` hostType
   if (
     GITLAB_API_USING_HOST_TYPES.includes(hostType) &&
-    hostType !== PLATFORM_TYPE_GITLAB
+    hostType !== PlatformId.Gitlab
   ) {
     res = {
       ...hostRules.find({
-        hostType: PLATFORM_TYPE_GITLAB,
+        hostType: PlatformId.Gitlab,
         url,
       }),
       ...res,
diff --git a/lib/workers/global/autodiscover.spec.ts b/lib/workers/global/autodiscover.spec.ts
index b5cdaaa7700f5b9ef412d3059ef6eb1452c7359b..076d179cc3fa9c0975c37f99154ec7f23d6931e2 100644
--- a/lib/workers/global/autodiscover.spec.ts
+++ b/lib/workers/global/autodiscover.spec.ts
@@ -1,5 +1,5 @@
 import type { RenovateConfig } from '../../config/types';
-import { PLATFORM_TYPE_GITHUB } from '../../constants/platforms';
+import { PlatformId } from '../../constants';
 import * as platform from '../../platform';
 import * as _ghApi from '../../platform/github';
 import * as _hostRules from '../../util/host-rules';
@@ -18,7 +18,7 @@ describe('workers/global/autodiscover', () => {
     jest.resetAllMocks();
     config = {};
     await platform.initPlatform({
-      platform: PLATFORM_TYPE_GITHUB,
+      platform: PlatformId.Github,
       token: '123test',
       endpoint: 'endpoint',
     });
@@ -28,7 +28,7 @@ describe('workers/global/autodiscover', () => {
   });
   it('autodiscovers github but empty', async () => {
     config.autodiscover = true;
-    config.platform = PLATFORM_TYPE_GITHUB;
+    config.platform = PlatformId.Github;
     hostRules.find = jest.fn(() => ({
       token: 'abc',
     }));
@@ -38,7 +38,7 @@ describe('workers/global/autodiscover', () => {
   });
   it('autodiscovers github repos', async () => {
     config.autodiscover = true;
-    config.platform = PLATFORM_TYPE_GITHUB;
+    config.platform = PlatformId.Github;
     hostRules.find = jest.fn(() => ({
       token: 'abc',
     }));
@@ -49,7 +49,7 @@ describe('workers/global/autodiscover', () => {
   it('filters autodiscovered github repos', async () => {
     config.autodiscover = true;
     config.autodiscoverFilter = 'project/re*';
-    config.platform = PLATFORM_TYPE_GITHUB;
+    config.platform = PlatformId.Github;
     hostRules.find = jest.fn(() => ({
       token: 'abc',
     }));
diff --git a/lib/workers/global/config/parse/env.spec.ts b/lib/workers/global/config/parse/env.spec.ts
index 528179ea0a99eabec895e7f1d0ca55800a70a925..714d2732eb6d0bfdb7dba52e0b491de2747132eb 100644
--- a/lib/workers/global/config/parse/env.spec.ts
+++ b/lib/workers/global/config/parse/env.spec.ts
@@ -1,8 +1,5 @@
 import type { RenovateOptions } from '../../../../config/types';
-import {
-  PLATFORM_TYPE_BITBUCKET,
-  PLATFORM_TYPE_GITLAB,
-} from '../../../../constants/platforms';
+import { PlatformId } from '../../../../constants';
 import * as env from './env';
 
 describe('workers/global/config/parse/env', () => {
@@ -74,7 +71,7 @@ describe('workers/global/config/parse/env', () => {
     });
     it('supports GitLab token', () => {
       const envParam: NodeJS.ProcessEnv = {
-        RENOVATE_PLATFORM: PLATFORM_TYPE_GITLAB,
+        RENOVATE_PLATFORM: PlatformId.Gitlab,
         RENOVATE_TOKEN: 'a gitlab.com token',
       };
       // FIXME: explicit assert condition
@@ -82,7 +79,7 @@ describe('workers/global/config/parse/env', () => {
     });
     it('supports GitLab custom endpoint', () => {
       const envParam: NodeJS.ProcessEnv = {
-        RENOVATE_PLATFORM: PLATFORM_TYPE_GITLAB,
+        RENOVATE_PLATFORM: PlatformId.Gitlab,
         RENOVATE_TOKEN: 'a gitlab token',
         RENOVATE_ENDPOINT: 'a gitlab endpoint',
       };
@@ -158,7 +155,7 @@ describe('workers/global/config/parse/env', () => {
     });
     it('supports Bitbucket token', () => {
       const envParam: NodeJS.ProcessEnv = {
-        RENOVATE_PLATFORM: PLATFORM_TYPE_BITBUCKET,
+        RENOVATE_PLATFORM: PlatformId.Bitbucket,
         RENOVATE_ENDPOINT: 'a bitbucket endpoint',
         RENOVATE_USERNAME: 'some-username',
         RENOVATE_PASSWORD: 'app-password',
@@ -168,7 +165,7 @@ describe('workers/global/config/parse/env', () => {
     });
     it('supports Bitbucket username/password', () => {
       const envParam: NodeJS.ProcessEnv = {
-        RENOVATE_PLATFORM: PLATFORM_TYPE_BITBUCKET,
+        RENOVATE_PLATFORM: PlatformId.Bitbucket,
         RENOVATE_ENDPOINT: 'a bitbucket endpoint',
         RENOVATE_USERNAME: 'some-username',
         RENOVATE_PASSWORD: 'app-password',
diff --git a/lib/workers/global/config/parse/env.ts b/lib/workers/global/config/parse/env.ts
index 10dc8abcfb40e9e9484dc79b9d59170452766bcd..a6e91c219ff7102db27dd83be47b0b2ef66b9787 100644
--- a/lib/workers/global/config/parse/env.ts
+++ b/lib/workers/global/config/parse/env.ts
@@ -2,7 +2,7 @@ import is from '@sindresorhus/is';
 
 import { getOptions } from '../../../../config/options';
 import type { AllConfig, RenovateOptions } from '../../../../config/types';
-import { PLATFORM_TYPE_GITHUB } from '../../../../constants/platforms';
+import { PlatformId } from '../../../../constants';
 import { getDatasourceList } from '../../../../datasource';
 import { logger } from '../../../../logger';
 import type { HostRule } from '../../../../types';
@@ -82,7 +82,7 @@ export function getConfig(env: NodeJS.ProcessEnv): AllConfig {
   if (env.GITHUB_COM_TOKEN) {
     logger.debug(`Converting GITHUB_COM_TOKEN into a global host rule`);
     config.hostRules.push({
-      hostType: PLATFORM_TYPE_GITHUB,
+      hostType: PlatformId.Github,
       matchHost: 'github.com',
       token: env.GITHUB_COM_TOKEN,
     });
diff --git a/lib/workers/global/index.spec.ts b/lib/workers/global/index.spec.ts
index 13d93bcba47971b61c51e666f46a713a8c0b26fb..92f46e7e91ca4f9e554c637fe695693772646bc5 100644
--- a/lib/workers/global/index.spec.ts
+++ b/lib/workers/global/index.spec.ts
@@ -1,10 +1,7 @@
 import { expect } from '@jest/globals';
 import { ERROR, WARN } from 'bunyan';
 import { fs, logger } from '../../../test/util';
-import {
-  PLATFORM_TYPE_GITHUB,
-  PLATFORM_TYPE_GITLAB,
-} from '../../constants/platforms';
+import { PlatformId } from '../../constants';
 import * as datasourceDocker from '../../datasource/docker';
 import * as _platform from '../../platform';
 import * as _repositoryWorker from '../repository';
@@ -114,7 +111,7 @@ describe('workers/global/index', () => {
     it('github', async () => {
       configParser.parseConfigs.mockResolvedValueOnce({
         repositories: ['a'],
-        platform: PLATFORM_TYPE_GITHUB,
+        platform: PlatformId.Github,
         endpoint: 'https://github.com/',
       });
       await globalWorker.start();
@@ -124,7 +121,7 @@ describe('workers/global/index', () => {
     it('gitlab', async () => {
       configParser.parseConfigs.mockResolvedValueOnce({
         repositories: [{ repository: 'a' }],
-        platform: PLATFORM_TYPE_GITLAB,
+        platform: PlatformId.Gitlab,
         endpoint: 'https://my.gitlab.com/',
       });
       await globalWorker.start();
@@ -137,7 +134,7 @@ describe('workers/global/index', () => {
     it('successfully write file', async () => {
       configParser.parseConfigs.mockResolvedValueOnce({
         repositories: ['myOrg/myRepo'],
-        platform: PLATFORM_TYPE_GITHUB,
+        platform: PlatformId.Github,
         endpoint: 'https://github.com/',
         writeDiscoveredRepos: '/tmp/renovate-output.json',
       });
diff --git a/lib/workers/pr/changelog/github.spec.ts b/lib/workers/pr/changelog/github.spec.ts
index 8a260df07a9327f32fd6b505e9443f13760a13ab..95bfe0d6b85557ed0feb2047d3f2a3146807ecfd 100644
--- a/lib/workers/pr/changelog/github.spec.ts
+++ b/lib/workers/pr/changelog/github.spec.ts
@@ -1,5 +1,5 @@
 import * as httpMock from '../../../../test/http-mock';
-import { PLATFORM_TYPE_GITHUB } from '../../../constants/platforms';
+import { PlatformId } from '../../../constants';
 import * as hostRules from '../../../util/host-rules';
 import * as semverVersioning from '../../../versioning/semver';
 import type { BranchUpgradeConfig } from '../../types';
@@ -39,7 +39,7 @@ describe('workers/pr/changelog/github', () => {
     beforeEach(() => {
       hostRules.clear();
       hostRules.add({
-        hostType: PLATFORM_TYPE_GITHUB,
+        hostType: PlatformId.Github,
         matchHost: 'https://api.github.com/',
         token: 'abc',
       });
@@ -167,7 +167,7 @@ describe('workers/pr/changelog/github', () => {
 
     it('supports github enterprise and github.com changelog', async () => {
       hostRules.add({
-        hostType: PLATFORM_TYPE_GITHUB,
+        hostType: PlatformId.Github,
         token: 'super_secret',
         matchHost: 'https://github-enterprise.example.com/',
       });
@@ -182,7 +182,7 @@ describe('workers/pr/changelog/github', () => {
 
     it('supports github enterprise and github enterprise changelog', async () => {
       hostRules.add({
-        hostType: PLATFORM_TYPE_GITHUB,
+        hostType: PlatformId.Github,
         matchHost: 'https://github-enterprise.example.com/',
         token: 'abc',
       });
diff --git a/lib/workers/pr/changelog/gitlab.spec.ts b/lib/workers/pr/changelog/gitlab.spec.ts
index 1235d29d958f5e7d31d669d8aab667aa81373f2b..7894bc600812a70f8312d4628b74ebac1cb5d4f1 100644
--- a/lib/workers/pr/changelog/gitlab.spec.ts
+++ b/lib/workers/pr/changelog/gitlab.spec.ts
@@ -1,5 +1,5 @@
 import * as httpMock from '../../../../test/http-mock';
-import { PLATFORM_TYPE_GITLAB } from '../../../constants/platforms';
+import { PlatformId } from '../../../constants';
 import * as hostRules from '../../../util/host-rules';
 import * as semverVersioning from '../../../versioning/semver';
 import type { BranchUpgradeConfig } from '../../types';
@@ -40,7 +40,7 @@ describe('workers/pr/changelog/gitlab', () => {
     beforeEach(() => {
       hostRules.clear();
       hostRules.add({
-        hostType: PLATFORM_TYPE_GITLAB,
+        hostType: PlatformId.Gitlab,
         matchHost,
         token: 'abc',
       });
@@ -181,7 +181,7 @@ describe('workers/pr/changelog/gitlab', () => {
     });
     it('supports gitlab enterprise and gitlab enterprise changelog', async () => {
       hostRules.add({
-        hostType: PLATFORM_TYPE_GITLAB,
+        hostType: PlatformId.Gitlab,
         matchHost: 'https://gitlab-enterprise.example.com/',
         token: 'abc',
       });
@@ -198,7 +198,7 @@ describe('workers/pr/changelog/gitlab', () => {
     it('supports self-hosted gitlab changelog', async () => {
       httpMock.scope('https://git.test.com').persist().get(/.*/).reply(200, []);
       hostRules.add({
-        hostType: PLATFORM_TYPE_GITLAB,
+        hostType: PlatformId.Gitlab,
         matchHost: 'https://git.test.com/',
         token: 'abc',
       });
@@ -207,7 +207,7 @@ describe('workers/pr/changelog/gitlab', () => {
       expect(
         await getChangeLogJSON({
           ...upgrade,
-          platform: PLATFORM_TYPE_GITLAB,
+          platform: PlatformId.Gitlab,
           sourceUrl: 'https://git.test.com/meno/dropzone/',
           endpoint: 'https://git.test.com/api/v4/',
         })
diff --git a/lib/workers/pr/changelog/index.spec.ts b/lib/workers/pr/changelog/index.spec.ts
index ae462fceeca81244c82e5b7e1eae3b0c82308ead..051a141def702d9304ebe514a95f888814d569d6 100644
--- a/lib/workers/pr/changelog/index.spec.ts
+++ b/lib/workers/pr/changelog/index.spec.ts
@@ -1,6 +1,6 @@
 import * as httpMock from '../../../../test/http-mock';
 import { partial } from '../../../../test/util';
-import { PLATFORM_TYPE_GITHUB } from '../../../constants/platforms';
+import { PlatformId } from '../../../constants';
 import * as hostRules from '../../../util/host-rules';
 import * as semverVersioning from '../../../versioning/semver';
 import type { BranchConfig } from '../../types';
@@ -36,7 +36,7 @@ describe('workers/pr/changelog/index', () => {
     beforeEach(() => {
       hostRules.clear();
       hostRules.add({
-        hostType: PLATFORM_TYPE_GITHUB,
+        hostType: PlatformId.Github,
         matchHost: 'https://api.github.com/',
         token: 'abc',
       });
@@ -193,7 +193,7 @@ describe('workers/pr/changelog/index', () => {
     it('supports github enterprise and github.com changelog', async () => {
       httpMock.scope(githubApiHost).persist().get(/.*/).reply(200, []);
       hostRules.add({
-        hostType: PLATFORM_TYPE_GITHUB,
+        hostType: PlatformId.Github,
         token: 'super_secret',
         matchHost: 'https://github-enterprise.example.com/',
       });
@@ -213,7 +213,7 @@ describe('workers/pr/changelog/index', () => {
         .get(/.*/)
         .reply(200, []);
       hostRules.add({
-        hostType: PLATFORM_TYPE_GITHUB,
+        hostType: PlatformId.Github,
         matchHost: 'https://github-enterprise.example.com/',
         token: 'abc',
       });
@@ -236,7 +236,7 @@ describe('workers/pr/changelog/index', () => {
         .get(/.*/)
         .reply(200, []);
       hostRules.add({
-        hostType: PLATFORM_TYPE_GITHUB,
+        hostType: PlatformId.Github,
         matchHost: 'https://github-enterprise.example.com/',
         token: 'abc',
       });
diff --git a/lib/workers/pr/changelog/source-github.ts b/lib/workers/pr/changelog/source-github.ts
index 3dee765d2e0825caae1d896f0a224f2267d1b52a..720ef8c4d8b0c18b0f78146fcdb23744820a5c84 100644
--- a/lib/workers/pr/changelog/source-github.ts
+++ b/lib/workers/pr/changelog/source-github.ts
@@ -1,5 +1,5 @@
 import URL from 'url';
-import { PLATFORM_TYPE_GITHUB } from '../../../constants/platforms';
+import { PlatformId } from '../../../constants';
 import type { Release } from '../../../datasource/types';
 import { logger } from '../../../logger';
 import * as memCache from '../../../util/cache/memory';
@@ -47,7 +47,7 @@ export async function getChangeLogJSON({
     ? 'https://api.github.com/'
     : sourceUrl;
   const config = hostRules.find({
-    hostType: PLATFORM_TYPE_GITHUB,
+    hostType: PlatformId.Github,
     url,
   });
   // istanbul ignore if
diff --git a/lib/workers/pr/index.spec.ts b/lib/workers/pr/index.spec.ts
index d82283479371cde896a39555792fd3b28e3fa890..63e7ae7cab6f424d652c24c837ebbd962b24c680 100644
--- a/lib/workers/pr/index.spec.ts
+++ b/lib/workers/pr/index.spec.ts
@@ -1,5 +1,5 @@
 import { getConfig, git, mocked, partial, platform } from '../../../test/util';
-import { PLATFORM_TYPE_GITLAB } from '../../constants/platforms';
+import { PlatformId } from '../../constants';
 import type { Pr } from '../../platform/types';
 import { BranchStatus } from '../../types';
 import * as _limits from '../global/limits';
@@ -621,7 +621,7 @@ describe('workers/pr/index', () => {
       git.getBranchLastCommitTime.mockResolvedValueOnce(new Date());
       config.prCreation = 'not-pending';
       config.artifactErrors = [{}];
-      config.platform = PLATFORM_TYPE_GITLAB;
+      config.platform = PlatformId.Gitlab;
       const { pr } = await prWorker.ensurePr(config);
       expect(pr).toMatchObject({ displayNumber: 'New Pull Request' });
     });
diff --git a/lib/workers/repository/dependency-dashboard.spec.ts b/lib/workers/repository/dependency-dashboard.spec.ts
index d2c34f78cfd0110521d929f2aa9248817ea64788..ef16629b7a969c5280795e3ceeccdc557a1c811e 100644
--- a/lib/workers/repository/dependency-dashboard.spec.ts
+++ b/lib/workers/repository/dependency-dashboard.spec.ts
@@ -8,7 +8,7 @@ import {
   platform,
 } from '../../../test/util';
 import { setGlobalConfig } from '../../config/global';
-import { PLATFORM_TYPE_GITHUB } from '../../constants/platforms';
+import { PlatformId } from '../../constants';
 import type { Platform } from '../../platform';
 import { BranchConfig, BranchResult, BranchUpgradeConfig } from '../types';
 import * as dependencyDashboard from './dependency-dashboard';
@@ -19,7 +19,7 @@ let config: RenovateConfig;
 beforeEach(() => {
   jest.clearAllMocks();
   config = getConfig();
-  config.platform = PLATFORM_TYPE_GITHUB;
+  config.platform = PlatformId.Github;
   config.errors = [];
   config.warnings = [];
 });
diff --git a/lib/workers/repository/finalise/prune.spec.ts b/lib/workers/repository/finalise/prune.spec.ts
index 05868f977131b09f07e9565a496a2e5a2cc925e9..6e2c0c7418e180f72a12e97bcc9c8183a85a694f 100644
--- a/lib/workers/repository/finalise/prune.spec.ts
+++ b/lib/workers/repository/finalise/prune.spec.ts
@@ -5,7 +5,7 @@ import {
   platform,
 } from '../../../../test/util';
 import { setGlobalConfig } from '../../../config/global';
-import { PLATFORM_TYPE_GITHUB } from '../../../constants/platforms';
+import { PlatformId } from '../../../constants';
 import * as cleanup from './prune';
 
 jest.mock('../../../util/git');
@@ -14,7 +14,7 @@ let config: RenovateConfig;
 beforeEach(() => {
   jest.resetAllMocks();
   config = getConfig();
-  config.platform = PLATFORM_TYPE_GITHUB;
+  config.platform = PlatformId.Github;
   config.errors = [];
   config.warnings = [];
 });