fix(gitFs): allow admin renovateFork override

This commit is contained in:
Rhys Arkins 2018-12-23 08:47:22 +02:00
parent 5b43931aab
commit 10d0f58c88

View file

@ -114,6 +114,7 @@ async function initRepo({
gitPrivateKey,
gitFs,
localDir,
renovateFork,
}) {
logger.debug(`initRepo("${repository}")`);
logger.info(
@ -151,16 +152,16 @@ async function initRepo({
res = await get(`repos/${repository}`);
logger.trace({ repositoryDetails: res.body }, 'Repository details');
// istanbul ignore if
if (res.body.fork && gitFs) {
if (res.body.fork && gitFs && !renovateFork) {
try {
const { renovateFork } = JSON.parse(
const renovateConfig = JSON.parse(
Buffer.from(
(await get(`repos/${config.repository}/contents/renovate.json`))
.body.content,
'base64'
).toString()
);
if (!renovateFork) {
if (!renovateConfig.renovateFork) {
throw new Error();
}
} catch (err) {