I want to get the last tag and assign it to a variable created in my Azure Pipeline
this is what I'm doing
Create variable
Any ideas? Thanks
I want to get the last tag and assign it to a variable created in my Azure Pipeline
this is what I'm doing
Create variable
Any ideas? Thanks
Get git last tag into Azure pipeline variable
The code I tested was also incorrect. To get the git last tag, you could use following powershell scripts, it works fine on my side:
cd $(System.DefaultWorkingDirectory)
$Latesttag = $(git describe --tags $(git rev-list --tags --max-count=1))
Write-Host "The latest git tag is $Latesttag "
You could check this thread for some details.
Hope this helps.
It was not clear but part of the question was how to set an Azure pipeline variable in powerShell task
$tag = $(git describe --tags $(git rev-list --tags --max-count=1))
Write-Host "##vso[task.setvariable variable=version]$tag"
version is the variable to set