Replies: 2 comments 1 reply
-
I don't use AzDO myself, but in GitHub Actions you have to explicitly export output variables from a job in order to consume them from another job. Is something like that possible in AzDO, perhaps? |
Beta Was this translation helpful? Give feedback.
-
Yes, you can! But you have to use a special syntax: When GitVersion runs, it creates variables that can be used by tasks running in the same job simply as So, in your case, since the job you want to access the GitVersion variable from is in a different stage from the job that created the variable, you must use this Here's a really simple pipeline that defines two stages where the first stage calculates the version using GitVersion and the second stage merely consumes a variable.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
I have my azure devops pipeline like this
My
azure-pipelines-create-version-tag-template.yml
look like thisI want to access GitVersion variable
MajorMinorPatch
inside myCreateVersionTag
job.Do anyone know how I can do this or if it is even possible?
I have already tried replacing
$buildNumber
with$(GitVersion.MajorMinorPatch)
and$(GitVersion_MajorMinorPatch)
without success.I can access the variable just fine within my other template, which is where I have the
gitversion/setup@0
andgitversion/execute@0
tasks.Beta Was this translation helpful? Give feedback.
All reactions