简体   繁体   中英

Unexpected value in YAML


trigger:
  - develop

pool:
  vmImage: windows-2019

steps:
    - task: NuGetCommand@2
        inputs:
            command: "restore"
            restoreSolution: "**/*.sln"
            feedsToUse: "config"
    - task: MSBuild@1
        inputs:
            solution: "**/*.sln"
    - task: S3Upload@1
        inputs:
            regionName: "us-west-2"
            bucketName: "ssw-nonprod-ado-artifacts"
            globExpressions: "**"
            targetFolder: "nsspreproc"

I added the missing "steps" keyword as suggested on my previous question .

Now the errors I'm getting are:

/azure-pipelines.yml (Line: 11, Col: 12): Unexpected value

  • /azure-pipelines.yml (Line: 12, Col: 5): Unexpected value
  • /azure-pipelines.yml (Line: 13, Col: 5): Unexpected value
  • /azure-pipelines.yml (Line: 14, Col: 5): Unexpected value
  • /azure-pipelines.yml (Line: 16, Col: 12): Unexpected value
  • /azure-pipelines.yml (Line: 17, Col: 5): Unexpected value
  • /azure-pipelines.yml (Line: 19, Col: 12): Unexpected value
  • /azure-pipelines.yml (Line: 20, Col: 5): Unexpected value
  • /azure-pipelines.yml (Line: 21, Col: 5): Unexpected value
  • /azure-pipelines.yml (Line: 22, Col: 5): Unexpected value

For example line 11 column 12 is right after the colon (:) on the first "inputs".

I've tried changing up the indentation and using single quotes vs double quotes, but none of that seems to help. What am I missing?

Dave Newton is absolutely right, your YAML is not valid.

在此处输入图像描述

This is the valid version of your YAML:

trigger:
  - develop
pool:
  vmImage: windows-2019
steps:
  - task: NuGetCommand@2
    inputs:
      command: restore
      restoreSolution: "**/*.sln"
      feedsToUse: config
  - task: MSBuild@1
    inputs:
      solution: "**/*.sln"
  - task: S3Upload@1
    inputs:
      regionName: us-west-2
      bucketName: ssw-nonprod-ado-artifacts
      globExpressions: "**"
      targetFolder: nsspreproc

在此处输入图像描述

Word of advice, please take a good look at your white spaces and indentation:

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2025 STACKOOM.COM