Skip to content
Snippets Groups Projects
Commit 3c141584 authored by Rhys Arkins's avatar Rhys Arkins Committed by GitHub
Browse files

fix: rename and delete erroneous onboarding PRs if found (#948)

parent 74a590ae
Branches
No related tags found
No related merge requests found
......@@ -71,6 +71,21 @@ async function renovateRepository(repoConfig, token) {
// If we can't detect any package.json then return
if (config.packageFiles.length === 0) {
logger.info('Cannot detect package files');
// istanbul ignore if
if (config.repoIsOnboarded === false) {
logger.warn('Need to delete onboarding PR');
const pr = await config.api.getBranchPr(config.onboardingBranch);
if (pr) {
logger.info('Found onboarding PR');
await config.api.updatePr(
pr.number,
'Configure Renovate - canceled',
'This PR was created in error and is now being deleted automatically. Sorry for the inconvenience.'
);
await config.api.deleteBranch(config.onboardingBranch);
throw new Error('no package files');
}
}
return;
}
logger.debug(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment