mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 15:06:27 +00:00
fix(gitFs): allow admin renovateFork override
This commit is contained in:
parent
5b43931aab
commit
10d0f58c88
1 changed files with 4 additions and 3 deletions
|
@ -114,6 +114,7 @@ async function initRepo({
|
||||||
gitPrivateKey,
|
gitPrivateKey,
|
||||||
gitFs,
|
gitFs,
|
||||||
localDir,
|
localDir,
|
||||||
|
renovateFork,
|
||||||
}) {
|
}) {
|
||||||
logger.debug(`initRepo("${repository}")`);
|
logger.debug(`initRepo("${repository}")`);
|
||||||
logger.info(
|
logger.info(
|
||||||
|
@ -151,16 +152,16 @@ async function initRepo({
|
||||||
res = await get(`repos/${repository}`);
|
res = await get(`repos/${repository}`);
|
||||||
logger.trace({ repositoryDetails: res.body }, 'Repository details');
|
logger.trace({ repositoryDetails: res.body }, 'Repository details');
|
||||||
// istanbul ignore if
|
// istanbul ignore if
|
||||||
if (res.body.fork && gitFs) {
|
if (res.body.fork && gitFs && !renovateFork) {
|
||||||
try {
|
try {
|
||||||
const { renovateFork } = JSON.parse(
|
const renovateConfig = JSON.parse(
|
||||||
Buffer.from(
|
Buffer.from(
|
||||||
(await get(`repos/${config.repository}/contents/renovate.json`))
|
(await get(`repos/${config.repository}/contents/renovate.json`))
|
||||||
.body.content,
|
.body.content,
|
||||||
'base64'
|
'base64'
|
||||||
).toString()
|
).toString()
|
||||||
);
|
);
|
||||||
if (!renovateFork) {
|
if (!renovateConfig.renovateFork) {
|
||||||
throw new Error();
|
throw new Error();
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
Loading…
Reference in a new issue