You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'PR commits and changes branch in sync, safe to re-align'
1488
-
);
1489
-
safeToRealign=true;
1490
-
}
1491
-
}catch(err: unknown){
1492
-
// if a branch of commit cannot be found it is likely the PR commits information aren't in a reliable state, in
1493
-
// this case just ignore and continue with the next check
1494
-
if(isOctokitRequestError(err)&&err.status===404){
1495
-
this.logger.debug(
1496
-
`Could not compare commits from PR and '${branchName.changesBranch}' due to a branch or commit not found. Continue with the next check`
1497
-
);
1498
-
}else{
1499
-
throwerr;
1500
-
}
1501
-
}
1502
-
1503
-
// then check if changes-branch has already been synced with the base branch, in which case we don't need to do
1504
-
// anything
1505
-
if(
1506
-
!safeToRealign&&
1507
-
(awaitthis.github.isBranchASyncedWithB(
1508
-
branchName.changesBranch,
1509
-
this.targetBranch
1510
-
))
1511
-
){
1512
-
this.logger.debug(
1513
-
`Checking if ${branchName.changesBranch} is synced with ${this.targetBranch}...`
1514
-
);
1515
-
this.logger.debug('Branches already in sync, no need to re-align');
1516
-
return;
1517
-
}
1518
-
1519
-
if(!safeToRealign){
1520
-
thrownewError(
1521
-
`Branch '${branchName.changesBranch}' cannot be safely re-aligned with '${this.targetBranch}', and will likely result in git conflicts when the next release PR is created. Hint: compare branches '${pr.headBranchName}', '${branchName.changesBranch}', and '${this.targetBranch}' for inconsistencies`
1522
-
);
1523
-
}
1524
-
1525
-
awaitthis.github.alignBranchWithAnother(
1526
-
branchName.changesBranch,
1527
-
this.targetBranch
1528
-
);
1529
-
1530
-
// updating git branches isn't always instant and can take a bit of time to propagate throughout github systems,
1531
-
// it is safer to wait a little bit before doing anything else
0 commit comments