Skip to content
Snippets Groups Projects
Unverified Commit e4ff7ede authored by RahulGautamSingh's avatar RahulGautamSingh Committed by GitHub
Browse files

refactor: move stop-updating-label logic (#18350)

parent 4bac0edc
Branches
Tags
No related merge requests found
......@@ -176,6 +176,26 @@ export async function processBranch(
};
}
if (branchExists) {
// check if branch is labelled to stop
config.stopUpdating = branchPr?.labels?.includes(
config.stopUpdatingLabel!
);
const prRebaseChecked = !!branchPr?.bodyStruct?.rebaseRequested;
if (branchExists && !dependencyDashboardCheck && config.stopUpdating) {
if (!prRebaseChecked) {
logger.info(
'Branch updating is skipped because stopUpdatingLabel is present in config'
);
return {
branchExists: true,
prNo: branchPr?.number,
result: BranchResult.NoWork,
};
}
}
logger.debug('Checking if PR has been edited');
const branchIsModified = await isBranchModified(config.branchName);
if (branchPr) {
......@@ -482,25 +502,6 @@ export async function processBranch(
(await isBranchConflicted(config.baseBranch, config.branchName));
config.forceCommit = forcedManually || config.isConflicted;
config.stopUpdating = branchPr?.labels?.includes(
config.stopUpdatingLabel!
);
const prRebaseChecked = !!branchPr?.bodyStruct?.rebaseRequested;
if (branchExists && !dependencyDashboardCheck && config.stopUpdating) {
if (!prRebaseChecked) {
logger.info(
'Branch updating is skipped because stopUpdatingLabel is present in config'
);
return {
branchExists: true,
prNo: branchPr?.number,
result: BranchResult.NoWork,
};
}
}
// compile commit message with body, which maybe needs changelogs
if (config.commitBody) {
if (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment