Search code examples
gitazure-devopsazure-pipelinesazure-pipelines-build-taskgithub-release

Github Release Azure Pipeline task - tagpattern wildcards does not work


Have an issue setting up a github release task in my azure devops pipeline. The pipeline yml looks like the following (its for a multi framework nuget package if that is of any use):

trigger:
- master

pool:
  vmImage: 'ubuntu-latest'

workspace:
    clean: all

...

- task: GitHubRelease@1
  inputs:
    gitHubConnection: '**/**'
    repositoryName: '$(Build.Repository.Name)'
    action: 'create'
    target: '$(Build.SourceVersion)'
    tagSource: 'gitTag'
    tagPattern: 'v*'
    changeLogCompareToRelease: 'lastFullRelease'
    changeLogType: 'commitBased'

I i enter the exact name of the tag (for example tagPattern: 'v1') it works fine. If i use the tagpattern above and push the same tag, v1, it just gives me ##[warning]Release will not be created as the tags for the target commit do not match with the given tag pattern warning.

I tried some other regex patterns but it seems that pattern matching does not work at all, only specifying the exact git tag name. So my question is if there is some known issue im not aware of or if im missing something i should be doing here?


Solution

  • Judging from the code, it's pasting the tag pattern into a regex. Your current pattern would thus match zero or more v's. You'd need v.* to match any tags that start with v.

    See: