diff --git a/lib/modules/platform/index.spec.ts b/lib/modules/platform/index.spec.ts
index 0c9df4dd743cc3f9ea5f8ddac9d12d338f7a9100..ba3eb516165a57ee7de197976470b901b4514542 100644
--- a/lib/modules/platform/index.spec.ts
+++ b/lib/modules/platform/index.spec.ts
@@ -141,18 +141,18 @@ describe('modules/platform/index', () => {
         endpoint: 'https://api.github.com/',
         gitAuthor: 'user@domain.com',
         hostRules: [
-          {
-            hostType: 'github',
-            matchHost: 'github.com',
-            token: '456',
-            username: 'def',
-          },
           {
             hostType: 'docker',
             matchHost: 'ghcr.io',
             password: '123',
             username: 'USERNAME',
           },
+          {
+            hostType: 'github',
+            matchHost: 'github.com',
+            token: '456',
+            username: 'def',
+          },
           {
             hostType: 'github',
             matchHost: 'api.github.com',
diff --git a/lib/modules/platform/index.ts b/lib/modules/platform/index.ts
index 7c9b4bc4dfc60949bc610115ca372d60ad24d8cb..d06cc3fdf4470830ccea79f4bd075f689f133d77 100644
--- a/lib/modules/platform/index.ts
+++ b/lib/modules/platform/index.ts
@@ -51,8 +51,8 @@ export async function initPlatform(config: AllConfig): Promise<AllConfig> {
     ...config,
     ...platformInfo,
     hostRules: [
-      ...(config.hostRules ?? []),
       ...(platformInfo?.hostRules ?? []),
+      ...(config.hostRules ?? []),
     ],
   };
   // istanbul ignore else