How do you avoid building the same commit twice (branch and PR)?
BeginnerConceptMultibranch, organization folders & webhooks
Answer
In the branch discovery trait choose Exclude branches that are also filed as PRs. Then a feature branch with an open PR is built only as PR-123, while main and branches without PRs build as branches. Choose PR strategy Merging the pull request with the current target branch revision so you test what will actually land.
More on Multibranch, organization folders & webhooks
How does a multibranch pipeline work?BeginnerWhat is branch indexing and what triggers it?BeginnerWhat are the discovery traits in the GitHub branch source?IntermediateWhat does the fork PR trust setting protect against?AdvancedWhat environment variables are set for PR builds?BeginnerWhat is an organization folder?Intermediate