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.

feature/*

  • 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/*.

feature/bb-123-fix-links

  • 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.

' master ' and duplicate branch names

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

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

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

Last modified on Nov 18, 2020
Cached at 9:27 PM on Jan 20, 2021 |

Additional Help

Ask the Community