Deploy on branch with wildcard or regular expression

Matthias's Avatar

Matthias

27 Jan, 2017 05:55 PM

Hi,
i would like to deploy only when the branch is "release/..." (in my example: "release/1.0.0")
I tried wildcard and regular expressions:

deploy:
 -   provider: NuGet
 ...
    on:
        branch: release/*

etc. However, the results were always like:

"NuGet" deployment for branch "release/*" has been skipped because current branch is "release/1.0.0"
"NuGet" deployment for branch "release\/.*" has been skipped because current branch is "release/1.0.0"
"NuGet" deployment for branch "release/.*" has been skipped because current branch is "release/1.0.0"

BR Matthias

  1. Support Staff 1 Posted by Ilya Finkelshte... on 27 Jan, 2017 06:13 PM

    Ilya Finkelshteyn's Avatar

    Hi Matthias,

    Regular expressions should be surrounded by forward slashes /. Respective part of YAML may look like this:

        on:
            branch: /release\/[0-9, .]+/
    
    or simple
        on:
            branch: /release\/.+/
    

    Thanks!
    Ilya.

  2. 2 Posted by Matthias on 28 Jan, 2017 09:45 AM

    Matthias's Avatar

    Feeling stupid now. ¯_(ツ)_/¯

    Thx a lot - works like a charm!
    BR Matthias

  3. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:14 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac