Azure-pipelines-agent: Exported YAML not valid - "Mapping values are not allowed in this context"

Created on 6 Jul 2018  路  3Comments  路  Source: microsoft/azure-pipelines-agent

Have you tried trouble shooting?

yes

Agent Version and Platform

Hosted VS2017

VSTS Type and Version

VisualStudio.com

What's not working?

When build definition is exported using "View YAML" the following was included:

displayName: Publish Artifact: Deploy

If I try to create a build using the exported yaml this results in the following error: "Mapping values are not allowed in this context"

Wrapping the displayName value in single quotes as follows resolved the issue:

displayName: 'Publish Artifact: Deploy'

The exported YAML should be valid and a clearer error message would be helpful.

Most helpful comment

@MireilleHanna is working on a fix for this.

All 3 comments

@MireilleHanna is working on a fix for this.

this in master and will roll out with the next sprint deployment

I am still seeing this error but only for some steps - here is the YAML shown by View YAML - note the lack of single quotes for GitVersion step display name:

steps:
- task: gittools.gitversion.gitversion-task.GitVersion@4
  displayName: GitVersion
  inputs:
    preferBundledVersion: false

- task: DotNetCoreCLI@2
  displayName: 'dotnet restore'
  inputs:
    command: restore
    projects: '**/*.csproj'
    vstsFeed: '2776577c-a22b-427d-b0b5-59ad9e7bca42'

Was this page helpful?
0 / 5 - 0 ratings