On a NuGet library, I'm using the develop
branch as the continuous integration branch. I've set policies on it so that no pull request can be approved without it being built. Furthermore, any successful merge will cause a CI build to run and eventually a prerelease NuGet package will be created and pushed within a private NuGet feed.
When I'm satisfied with the prerelease behavior, I create an additional PR to merge develop
into master
, which in turn causes a CD build to be started, that will lead to a production release of the NuGet package.
Here's the thing though: it may happen that I'll want to create a hotfix branch straight from master, make some changes and then make a new PR of that branch straight back to master. This will launch the usual CD pipelines and cause a new release in production (with an incremented patch number).
The thing is though that I'll want to merge master back into develop thereafter, which right now creates a new prerelease version (which is irrelevant at this point).
Do I have a way to tell Azure DevOps that in the special case of master being merged back into develop, branch policies should be skipped? Do I even have to make a PR from master to develop, when really all I want to do is merging a previously approved PR from hotfix to master!?
Any advice is welcome.