How to get Git Tag in Azure Pipelines

前端 未结 8 1195
青春惊慌失措
青春惊慌失措 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:31

    According the this doc the Tag which started the build can be found in BUILD_SOURCEBRANCH.

    If this build was queued by the creation of a tag then this is the name of that tag. For Azure Pipelines, the BUILD_SOURCEBRANCH will be set to the full Git reference name, eg refs/tags/tag_name.

提交回复
热议问题