mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 06:56:24 +00:00
fix(worker): fix rebase requested check (#3987)
This commit is contained in:
parent
6db4c57aeb
commit
714d4b77f9
1 changed files with 16 additions and 18 deletions
|
@ -39,6 +39,10 @@ async function processBranch(branchConfig, prHourlyLimitReached, packageFiles) {
|
|||
if (masterIssueCheck) {
|
||||
logger.info('Branch has been checked in master issue: ' + masterIssueCheck);
|
||||
}
|
||||
if (branchPr) {
|
||||
config.rebaseRequested = rebaseCheck(config, branchPr);
|
||||
logger.debug(`Branch pr rebase requested: ${config.rebaseRequested}`);
|
||||
}
|
||||
try {
|
||||
logger.debug(`Branch has ${dependencies.length} upgrade(s)`);
|
||||
|
||||
|
@ -116,19 +120,7 @@ async function processBranch(branchConfig, prHourlyLimitReached, packageFiles) {
|
|||
}
|
||||
if (!branchPr.canRebase) {
|
||||
const subject = 'PR has been edited';
|
||||
const titleRebase =
|
||||
branchPr.title && branchPr.title.startsWith('rebase!');
|
||||
const labelRebase =
|
||||
branchPr.labels && branchPr.labels.includes(config.rebaseLabel);
|
||||
const prRebaseChecked =
|
||||
branchPr.body &&
|
||||
branchPr.body.includes(`- [x] <!-- ${appSlug}-rebase -->`);
|
||||
if (
|
||||
masterIssueCheck ||
|
||||
prRebaseChecked ||
|
||||
titleRebase ||
|
||||
labelRebase
|
||||
) {
|
||||
if (masterIssueCheck || config.rebaseRequested) {
|
||||
if (config.dryRun) {
|
||||
logger.info(
|
||||
'DRY-RUN: Would ensure PR edited comment removal in PR #' +
|
||||
|
@ -162,11 +154,7 @@ async function processBranch(branchConfig, prHourlyLimitReached, packageFiles) {
|
|||
logger.info('Skipping branch creation as not within schedule');
|
||||
return 'not-scheduled';
|
||||
}
|
||||
const prRebaseChecked =
|
||||
branchPr &&
|
||||
branchPr.body &&
|
||||
branchPr.body.includes(`- [x] <!-- ${appSlug}-rebase -->`);
|
||||
if (config.updateNotScheduled === false && !prRebaseChecked) {
|
||||
if (config.updateNotScheduled === false && !config.rebaseRequested) {
|
||||
logger.debug('Skipping branch update as not within schedule');
|
||||
return 'not-scheduled';
|
||||
}
|
||||
|
@ -479,3 +467,13 @@ async function processBranch(branchConfig, prHourlyLimitReached, packageFiles) {
|
|||
}
|
||||
return 'done';
|
||||
}
|
||||
|
||||
function rebaseCheck(config, branchPr) {
|
||||
const titleRebase = branchPr.title && branchPr.title.startsWith('rebase!');
|
||||
const labelRebase =
|
||||
branchPr.labels && branchPr.labels.includes(config.rebaseLabel);
|
||||
const prRebaseChecked =
|
||||
branchPr.body && branchPr.body.includes(`- [x] <!-- ${appSlug}-rebase -->`);
|
||||
|
||||
return titleRebase || labelRebase || prRebaseChecked;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue