mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 06:56:24 +00:00
fix: skip gitFs if unrenovated fork
This commit is contained in:
parent
9bfa8e120b
commit
3b387e92db
1 changed files with 20 additions and 0 deletions
|
@ -132,6 +132,23 @@ async function initRepo({
|
|||
res = await get(`repos/${repository}`);
|
||||
logger.trace({ repositoryDetails: res.body }, 'Repository details');
|
||||
// istanbul ignore if
|
||||
if (res.body.fork && gitFs) {
|
||||
try {
|
||||
const { renovateFork } = JSON.parse(
|
||||
Buffer.from(
|
||||
(await get(`repos/${config.repository}/contents/renovate.json`))
|
||||
.body.content,
|
||||
'base64'
|
||||
).toString()
|
||||
);
|
||||
if (!renovateFork) {
|
||||
throw new Error();
|
||||
}
|
||||
} catch (err) {
|
||||
throw new Error('fork');
|
||||
}
|
||||
}
|
||||
// istanbul ignore if
|
||||
if (res.body.full_name && res.body.full_name !== repository) {
|
||||
logger.info(
|
||||
{ repository, this_repository: res.body.full_name },
|
||||
|
@ -179,6 +196,9 @@ async function initRepo({
|
|||
if (err.message.startsWith('Repository access blocked')) {
|
||||
throw new Error('blocked');
|
||||
}
|
||||
if (err.message === 'fork') {
|
||||
throw err;
|
||||
}
|
||||
logger.info({ err }, 'Unknown GitHub initRepo error');
|
||||
throw err;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue