diff --git a/lib/platform/github/index.js b/lib/platform/github/index.js index ba1068bbce65f9fe6ae0bebe8997c8604aa2b3b2..6f8b494bab19c3791034b8e48f7bbc254d3041e9 100644 --- a/lib/platform/github/index.js +++ b/lib/platform/github/index.js @@ -208,6 +208,7 @@ async function initRepo({ // istanbul ignore if if (mirrorMode) { logger.info('Renovate is in mirrorMode'); + config.mirrorMode = true; const parentRepo = res.body.parent.full_name; logger.debug('Parent repo is ' + parentRepo); const parentDefaultBranch = (await get(`repos/${repository}`)).body @@ -764,7 +765,16 @@ async function createPr( useDefaultBranch, statusCheckVerify ) { - const base = useDefaultBranch ? config.defaultBranch : config.baseBranch; + let base = useDefaultBranch ? config.defaultBranch : config.baseBranch; + // istanbul ignore if + if (config.mirrorMode && branchName === 'renovate/configure') { + logger.debug('Using renovate-config as base branch for mirror config'); + if (!await branchExists('renovate-config')) { + const baseCommitSHA = await getBaseCommitSHA(); + await createBranch('renovate-config', baseCommitSHA); + } + base = 'renovate-config'; + } // Include the repository owner to handle forkMode and regular mode const head = `${config.repository.split('/')[0]}:${branchName}`; const options = {