-
Bug
-
Resolution: Timed out
-
Low
-
1
-
Severity 3 - Minor
-
91
-
Issue Summary
The Use glob patterns in pipelines documentation says that :
If you specify the exact name of a branch, a tag, or a bookmark, the pipeline defined for the specific branch overrides any more generic expressions that would match that branch.
However, the exact branch match does not take priority when you have other branch pipeline definitions that match multiple patterns (e.g '{feature/,dev/}')
Steps to Reproduce
- Create a Pipeline with multiple branch definitions and a branch exact match :
pipelines: branches: 'dev/mybranch': - step: script: - echo "this is for branch dev/mybranch " '{dev/*,feature/*}': - step: script: - echo "This is from branch pattern"
- Create a branch named dev/mybranch
- Run the pipeline for branch dev/mybranch
- The pipeline for the exact match 'dev/mybranch' should be executed, but instead the pipeline ' {dev/,feature/}' is triggered.
Expected Results
Bitbucket pipelines should prioritize the branch exact match.
Actual Results
The Bitbucket Pipelines should choose the exact match pipeline, but instead, the more generic pipeline is executed.
Workaround
This error only affects pipeline where you have multiple glob patterns in the same definition ((e.g '{feature/,dev/}') . The workaround is to separate the patterns into individual definitions and use YAML anchors to not have to repeat the steps script :
definitions: steps: - step: &build-test name: Build and test script: - mvn package artifacts: - target/** pipelines: branches: 'dev/mybranch': - step: script: - echo "this is for branch dev/mybranch " 'dev/*' : - step: *build-test 'feature/*': - step: *build-test