Leonardo
Leonardo

Reputation: 11387

Azure Pipeline - Get associated git TAG?

On my pipeline, I can retrieve the build number using the variable RELEASE.ARTIFACTS.MyPipeline_BUILDID. But I was wondering, how can I get the TAG associated with the build.

It is visible within the pipeline like:

enter image description here

is there a way to capture it in a variable within the yml so I properly concatenate it like:

enter image description here

Upvotes: 0

Views: 1865

Answers (1)

Shayki Abramczyk
Shayki Abramczyk

Reputation: 41545

You can use the variable SourceBranch:

The branch of the triggering repo the build was queued for. When your pipeline is triggered by a tag: refs/tags/your-tag-name

So, in the release the variable will be RELEASE.ARTIFACTS.MyPipeline_SOURCEBRANCH.

Upvotes: 1

Related Questions