Commonly people want to run particular stages when they match a specific branch name(s). We would like to make this pattern accessible in the editor.
Declarative allows the use of when to condition the stage execution like:
However, this isn't exactly what we would consider "friendly" for an editor accessible feature (though when will be supported via a text area) and the developer would have to learn the Script syntax to use it correctly.
We would like to formalise the pattern in a way that is more Editor and user friendly with the introduction of branch. Ideally we could tell from BO if the user has skipped via when or via branch.
Example - match single branch
This stage would only be executed if master was the name of the current branch.
Example - match branch name pattern
This stage would only be executed if the branch name started with feature/.
Example - expression
You can use an expression to achieve the same thing by: