In Azure Pipelines, I have enabled git tags to trigger pipelines like so:
trigger:
branches:
include:
- \'*\'
tags:
include:
- \'*\'
<
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.
2) I don't understand the question, if you pushed tag test
so the tag name will be 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
.
So just add a PowerShell task and print the value:
Write-Host $env:Build_SourceBranch