Use glob patterns on the Pipelines yaml file

Glob patterns don't allow any expression to start with a star. Every expression that starts with a star needs to be put in quotes.


  • Matches with feature/<any_branch>.

  • The glob pattern doesn't match the slash ( /), so Git branches like feature/<any_branch>/<my_branch> are not matched for feature/*.


  • 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. For example, let's say you specify a pipeline for feature/* and feature/bb-123-fix-links. On a commit to the feature/bb-123-fix-links branch, Pipelines executes the steps defined for feature/bb-123-fix-links and won't execute the steps defined in the feature/*.

' * '

  • Matches all branches, tags, or bookmarks. The star symbol ( * ) must be between single quotes.

  • This glob pattern doesn't match the slash (/ ), so Git branches like feature/bb-123-fix-links are not matched for '*'. If you need the slash to match, use '**' instead of '*'.

' ** '

  • Matches all branches, tags, or bookmarks. For example, it includes branches with the slash ( /) like feature/bb-123-fix-links. The ** expression must be in quotes.

' */feature '

  • This expression requires quotes.

' main ' and duplicate branch names

  • Names in quotes are treated the same way as names without quotes. For example, Pipelines sees main and 'main' as the same branch names.

  • In the situation described above, Pipelines will match only against one name (main or ' main', never both).

  • Try to avoid duplicating names in your bitbucket-pipelines.yml file.

Last modified on Jun 9, 2021
Cached at 4:13 AM on Oct 21, 2021 |

Additional Help