Closed treygilliland closed 11 months ago
Have you tried using the branch protection rule Require branches to be up to date before merging
?
We use this on all our repos internally to ensure that a PR cannot merge unless it has been rebased on the latest from the BASE branch.
That way nothing can merge without testing the merged code. In your example PR#2 hasn't really been tested properly because it did not include PR#1 changes.
We have found that avoiding excessive workflows that could fail AFTER merging is not desirable, and it is preferable to perform most of the rebasing and retesting upfront while the PR is still unmerged.
Yes, I did find this setting and start using it on the repo. Has been working well for us so will close.
An issue I continue to run into is the following:
This leaves the build from PR#2 without the code changes merged in PR#1 which has caused inconsistencies in our deployment process.
The desired functionality would be to detect that the main branch has changed and rebuild the build for PR#2. Not sure how complex that would be to implement so adding a flag to always rebuild on merge could also work