When you configure the pipeline to be triggers with tag the meaning that when new tag is pushed the pipeline start to run.
(当您将管道配置为使用标签触发时,意味着按下新标签时管道开始运行。)
so: (所以:)
1) The pipeline will start from the git tag.
(1)管道将从git标签开始。)
2) I don't understand the question, if you pushed tag test
so the tag name will be test
.
(2)我不明白这个问题,如果您按下标签test
那么标签名称将为test
。)
If you want to know programmatically if the build trigger was a tag and what is the tag name you can check the environment variable Build.SourceBranch
if the build is from a tag the value will be: refs/tags/tagName
.
(如果您想通过编程方式了解构建触发器是否是标签以及标签名称是什么,则可以检查环境变量Build.SourceBranch
如果构建来自标签),则值将为: refs/tags/tagName
。)
So just add a PowerShell task and print the value:
(因此,只需添加一个PowerShell任务并打印值即可:)
Write-Host $env:Build_SourceBranch
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…