How to get Git Tag in Azure Pipelines

前端 未结 8 1088
青春惊慌失措
青春惊慌失措 2021-02-07 07:28

In Azure Pipelines, I have enabled git tags to trigger pipelines like so:

trigger:
  branches:
    include:
    - \'*\'
  tags:
    include:
    - \'*\'
<         


        
8条回答
  •  深忆病人
    2021-02-07 08:05

    To answer your second question. If you don't mind having a separate pipeline for triggering through tags, then you can enable continuous integration and override the YAML trigger like shown below. This example will trigger builds with tags having the pattern 'test-*' (regardless of branch).

    By doing this, you can just execute git describe in your pipeline and it will output the name of the tag that triggered the build.

    Here you can see the result:

提交回复
热议问题