diff --git a/lib/platform/azure/index.ts b/lib/platform/azure/index.ts index 3c34c13911056e4d1809dbefe5162bca72e8a174..9b75df0ff01ff8422dd462159a03dd6448cc421e 100644 --- a/lib/platform/azure/index.ts +++ b/lib/platform/azure/index.ts @@ -122,6 +122,7 @@ export async function initRepo({ url, }); const repoConfig: RepoConfig = { + baseBranch: config.baseBranch, isFork: false, }; return repoConfig; diff --git a/lib/platform/bitbucket-server/index.ts b/lib/platform/bitbucket-server/index.ts index 788d48fb9982eabd93f503ff4ef50b947a14ef4a..c0ae8761a41d2598ee67475f67e2460ef5674ca9 100644 --- a/lib/platform/bitbucket-server/index.ts +++ b/lib/platform/bitbucket-server/index.ts @@ -192,6 +192,7 @@ export async function initRepo({ config.baseBranch = config.defaultBranch; config.mergeMethod = 'merge'; const repoConfig: RepoConfig = { + baseBranch: config.baseBranch, isFork: !!info.parent, }; return repoConfig; diff --git a/lib/platform/bitbucket/index.ts b/lib/platform/bitbucket/index.ts index 47f5623fd4d70f503bed7ac6fde36c048963b383..bbbe9d1838dcd78f79a9bcaac0fedce4e677dc76 100644 --- a/lib/platform/bitbucket/index.ts +++ b/lib/platform/bitbucket/index.ts @@ -122,6 +122,7 @@ export async function initRepo({ url, }); const repoConfig: RepoConfig = { + baseBranch: config.baseBranch, isFork: info.isFork, }; return repoConfig; diff --git a/lib/platform/common.ts b/lib/platform/common.ts index 57e8c5f3de0f322283705347ee8165d339134b5a..43e0ef5f6de0fe8ead3bb6ced21ffe6ac20456a2 100644 --- a/lib/platform/common.ts +++ b/lib/platform/common.ts @@ -46,6 +46,7 @@ export interface PlatformConfig { } export interface RepoConfig { + baseBranch: string; endpoint?: string; renovateUsername?: any; gitAuthor?: any; diff --git a/lib/platform/github/index.ts b/lib/platform/github/index.ts index 87cee09068c7fa9d44602e5f577aa0f065db8803..ca3c058c0295162331e1734d2112bdf23ccf3977 100644 --- a/lib/platform/github/index.ts +++ b/lib/platform/github/index.ts @@ -374,6 +374,7 @@ export async function initRepo({ url, }); const repoConfig: RepoConfig = { + baseBranch: config.baseBranch, isFork: res.body.fork === true, }; return repoConfig; diff --git a/lib/platform/gitlab/index.ts b/lib/platform/gitlab/index.ts index 09a19f35301172eeeadac3659399309a00c91963..87b79926bdf3910db7e3627818c6ff942470dfdc 100644 --- a/lib/platform/gitlab/index.ts +++ b/lib/platform/gitlab/index.ts @@ -191,6 +191,7 @@ export async function initRepo({ throw err; } const repoConfig: RepoConfig = { + baseBranch: config.baseBranch, isFork: !!res.body.forked_from_project, }; return repoConfig; diff --git a/test/platform/azure/__snapshots__/index.spec.ts.snap b/test/platform/azure/__snapshots__/index.spec.ts.snap index 5dbe39b57ad8289758a4a814dea2b79561ea886e..3b810b7a1a7cce63da988669acaefecf87dbea3d 100644 --- a/test/platform/azure/__snapshots__/index.spec.ts.snap +++ b/test/platform/azure/__snapshots__/index.spec.ts.snap @@ -135,6 +135,7 @@ Array [ exports[`platform/azure initRepo should initialise the config for a repo 2`] = ` Object { + "baseBranch": "defBr", "isFork": false, } `; diff --git a/test/platform/bitbucket-server/__snapshots__/index.spec.ts.snap b/test/platform/bitbucket-server/__snapshots__/index.spec.ts.snap index 74bd00343358cb5bda595635f9d75df5bd200125..c1cef2e052867c50c43eb6e4eb9c407a52d7b658 100644 --- a/test/platform/bitbucket-server/__snapshots__/index.spec.ts.snap +++ b/test/platform/bitbucket-server/__snapshots__/index.spec.ts.snap @@ -998,12 +998,14 @@ Object { exports[`platform/bitbucket-server endpoint with no path initRepo() does not throw 1`] = ` Object { + "baseBranch": "master", "isFork": false, } `; exports[`platform/bitbucket-server endpoint with no path initRepo() works 1`] = ` Object { + "baseBranch": "master", "isFork": false, } `; @@ -2470,12 +2472,14 @@ Object { exports[`platform/bitbucket-server endpoint with path initRepo() does not throw 1`] = ` Object { + "baseBranch": "master", "isFork": false, } `; exports[`platform/bitbucket-server endpoint with path initRepo() works 1`] = ` Object { + "baseBranch": "master", "isFork": false, } `; diff --git a/test/platform/bitbucket/__snapshots__/index.spec.ts.snap b/test/platform/bitbucket/__snapshots__/index.spec.ts.snap index 35862c35c24c8ea52f509ecad62e75062bb50552..9adeaf50ad294b55c251bf5ad2e75bc6374c1c4c 100644 --- a/test/platform/bitbucket/__snapshots__/index.spec.ts.snap +++ b/test/platform/bitbucket/__snapshots__/index.spec.ts.snap @@ -275,6 +275,7 @@ Object { exports[`platform/bitbucket initRepo() works 1`] = ` Object { + "baseBranch": "master", "isFork": false, } `; diff --git a/test/platform/github/__snapshots__/index.spec.ts.snap b/test/platform/github/__snapshots__/index.spec.ts.snap index bf4e9e4ae0c5e865aa5c6d9926ec766e19ad1d20..6446d9ae6562a951c035b24a7de7820e4d9973d1 100644 --- a/test/platform/github/__snapshots__/index.spec.ts.snap +++ b/test/platform/github/__snapshots__/index.spec.ts.snap @@ -414,36 +414,42 @@ Object { exports[`platform/github initRepo should forks when forkMode 1`] = ` Object { + "baseBranch": "master", "isFork": false, } `; exports[`platform/github initRepo should merge 1`] = ` Object { + "baseBranch": "master", "isFork": false, } `; exports[`platform/github initRepo should not guess at merge 1`] = ` Object { + "baseBranch": "master", "isFork": false, } `; exports[`platform/github initRepo should rebase 1`] = ` Object { + "baseBranch": "master", "isFork": false, } `; exports[`platform/github initRepo should squash 1`] = ` Object { + "baseBranch": "master", "isFork": false, } `; exports[`platform/github initRepo should update fork when forkMode 1`] = ` Object { + "baseBranch": "master", "isFork": false, } `;