question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unrecognized value "steps"

See original GitHub issue

When I try to use azure tasks from an example I have got this error

stages:
  - stage: gitversion
    # condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/master'), eq(variables['Build.SourceBranch'], 'refs/heads/develop')))
    jobs:
      - job: gitversion
        steps:
          - task: gitversion/setup@0
            displayName: Install GitVersion
            inputs:
              versionSpec: "5.1.3"
          - task: gitversion/execute@0
            displayName: Use GitVersion
          - script: |
              echo FullSemVer: $(fullSemVer)
              echo ##vso[build.updatebuildnumber]$(fullSemVer)
              echo Major: ${{ steps.gitversion.outputs.major }}
              echo Minor: ${{ steps.gitversion.outputs.minor }}
              echo Patch: ${{ steps.gitversion.outputs.patch }}
              echo PreReleaseTag: ${{ steps.gitversion.outputs.preReleaseTag }}
              echo PreReleaseTagWithDash: ${{ steps.gitversion.outputs.preReleaseTagWithDash }}
              echo PreReleaseLabel: ${{ steps.gitversion.outputs.preReleaseLabel }}
              echo PreReleaseNumber: ${{ steps.gitversion.outputs.preReleaseNumber }}
              echo WeightedPreReleaseNumber: ${{ steps.gitversion.outputs.weightedPreReleaseNumber }}
              echo BuildMetaData: ${{ steps.gitversion.outputs.buildMetaData }}
              echo BuildMetaDataPadded: ${{ steps.gitversion.outputs.buildMetaDataPadded }}
              echo FullBuildMetaData: ${{ steps.gitversion.outputs.fullBuildMetaData }}
              echo MajorMinorPatch: ${{ steps.gitversion.outputs.majorMinorPatch }}
              echo SemVer: ${{ steps.gitversion.outputs.semVer }}
              echo LegacySemVer: ${{ steps.gitversion.outputs.legacySemVer }}
              echo LegacySemVerPadded: ${{ steps.gitversion.outputs.legacySemVerPadded }}
              echo AssemblySemVer: ${{ steps.gitversion.outputs.assemblySemVer }}
              echo AssemblySemFileVer: ${{ steps.gitversion.outputs.assemblySemFileVer }}
              echo InformationalVersion: ${{ steps.gitversion.outputs.informationalVersion }}
              echo BranchName: ${{ steps.gitversion.outputs.branchName }}
              echo Sha: ${{ steps.gitversion.outputs.sha }}
              echo ShortSha: ${{ steps.gitversion.outputs.shortSha }}
              echo NuGetVersionV2: ${{ steps.gitversion.outputs.nuGetVersionV2 }}
              echo NuGetVersion: ${{ steps.gitversion.outputs.nuGetVersion }}
              echo NuGetPreReleaseTagV2: ${{ steps.gitversion.outputs.nuGetPreReleaseTagV2 }}
              echo NuGetPreReleaseTag: ${{ steps.gitversion.outputs.nuGetPreReleaseTag }}
              echo VersionSourceSha: ${{ steps.gitversion.outputs.versionSourceSha }}
              echo CommitsSinceVersionSource: ${{ steps.gitversion.outputs.commitsSinceVersionSource }}
              echo CommitsSinceVersionSourcePadded: ${{ steps.gitversion.outputs.commitsSinceVersionSourcePadded }}
              echo CommitDate: ${{ steps.gitversion.outputs.commitDate }}

/azure-pipelines.yml (Line: 35, Col: 21): Unrecognized value: 'steps'. Located at position 853 within expression: format('echo FullSemVer: $(fullSemVer) echo ##vso[build.updatebuildnumber]$(fullSemVer) echo Major: {0} echo Minor: {1} echo Patch: {2} echo PreReleaseTag: {3} echo PreReleaseTagWithDash: {4} echo PreReleaseLabel: {5} echo PreReleaseNumber: {6} echo WeightedPreReleaseNumber: {7} echo BuildMetaData: {8} echo BuildMetaDataPadded: {9} echo FullBuildMetaData: {10} echo MajorMinorPatch: {[...]

So how can I access to output from @execute task?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
gep13commented, Nov 20, 2020

@chris-codeflow thanks for your help in getting a PR done to cover this! We appreciate it!

1reaction
chris-codeflowcommented, Nov 18, 2020

The steps... syntax is invalid in Azure Pipelines, so all of the echo commands in the script using that syntax will result in an error.

GitVersion outputs both job-scoped (which can be accessed in subsequent steps in the same job) and multi-job output variables (which can be accessed in other jobs and stages) using the format GitVersion.<variable>. The following Azure Pipelines YAML is correct:

- task: gitversion/setup@0
  displayName: Install GitVersion
  inputs:
    versionSpec: '5.x'

- task: gitversion/execute@0
  displayName: Use GitVersion

- script: |
    echo Major: $(GitVersion.Major)
    echo Minor: $(GitVersion.Minor)
    echo Patch: $(GitVersion.Patch)
    echo PreReleaseTag: $(GitVersion.PreReleaseTag)
    echo PreReleaseTagWithDash: $(GitVersion.PreReleaseTagWithDash)
    echo PreReleaseLabel: $(GitVersion.PreReleaseLabel)
    echo PreReleaseNumber: $(GitVersion.PreReleaseNumber)
    echo WeightedPreReleaseNumber: $(GitVersion.WeightedPreReleaseNumber)
    echo BuildMetaData: $(GitVersion.BuildMetaData)
    echo BuildMetaDataPadded: $(GitVersion.BuildMetaDataPadded)
    echo FullBuildMetaData: $(GitVersion.FullBuildMetaData)
    echo MajorMinorPatch: $(GitVersion.MajorMinorPatch)
    echo SemVer: $(GitVersion.SemVer)
    echo LegacySemVer: $(GitVersion.LegacySemVer)
    echo LegacySemVerPadded: $(GitVersion.LegacySemVerPadded)
    echo AssemblySemVer: $(GitVersion.AssemblySemVer)
    echo AssemblySemFileVer: $(GitVersion.AssemblySemFileVer)
    echo FullSemVer: $(GitVersion.FullSemVer)
    echo InformationalVersion: $(GitVersion.InformationalVersion)
    echo BranchName: $(GitVersion.BranchName)
    echo EscapedBranchName: $(GitVersion.EscapedBranchName)
    echo Sha: $(GitVersion.Sha)
    echo ShortSha: $(GitVersion.ShortSha)
    echo NuGetVersionV2: $(GitVersion.NuGetVersionV2)
    echo NuGetVersion: $(GitVersion.NuGetVersion)
    echo NuGetPreReleaseTagV2: $(GitVersion.NuGetPreReleaseTagV2)
    echo NuGetPreReleaseTag: $(GitVersion.NuGetPreReleaseTag)
    echo VersionSourceSha: $(GitVersion.VersionSourceSha)
    echo CommitsSinceVersionSource: $(GitVersion.CommitsSinceVersionSource)
    echo CommitsSinceVersionSourcePadded: $(GitVersion.CommitsSinceVersionSourcePadded)
    echo UncommittedChanges: $(GitVersion.UncommittedChanges)
    echo CommitDate: $(GitVersion.CommitDate)

Azure Pipelines creates environment variables from the job-scoped variables of the form GITVERSION_<ALLCAPSVARIABLE> which you can also use in the same job.

I will be correcting the example and adding new ones (including how to access the variables in different jobs and stages) to address issue #236.

Read more comments on GitHub >

github_iconTop Results From Across the Web

yaml pipeline job condition throwing unrecognized value error
When I try to run this I get the following error: An error occurred while loading the YAML build pipeline. Unrecognized value: 'iPhone'....
Read more >
Split expression example fails with error "unrecognized value ...
Hello, The documentation provides the following example for split expression: variables: - name: environments value: prod1,prod2 steps: ...
Read more >
Create copy of process give error " VS1640105: Unrecognized ...
As title says, the “create copy of process” is giving the popular VS1640105 error when I attempt to copy a customized process.
Read more >
Resolve validation errors - Azure DevOps Services
If you've received a validation error when you tried import process, you'll need to resolve the error before retrying the import. Each error...
Read more >
If, elseif or else in Azure DevOps Pipelines - Thomas Thornton
value : "purple". stages: - stage : EnvironmentToDeploy. jobs: - job : colour. steps: - task : Bash@3. displayName: EnvironmentSelected.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found