[英]Azure DevOps Pipeline - YAML formatting error?
Would anyone know how to solve the following error?有人知道如何解决以下错误吗?
# Starter pipeline
- task: CloudFormationCreateOrUpdateStack@1
inputs:
awsCredentials: 'aws_test'
regionName: 'us-east-1'
stackName: 'test'
templateSource: 'url'
templateUrl: 'https://gist.githubusercontent.com/lizrice/5889f33511aab739d873cb622688317e/raw/c2ba38eb72b350fec28b50df0d8f74b51e1a68e8/vpc-fargate.yaml'
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- script: echo Hello, world!
displayName: 'Run a one-line script'
- script: |
echo Add other tasks to build, test, and deploy your project.
echo See https://aka.ms/yaml
displayName: 'Run a multi-line script'
The error I get on azure devops & yaml lint我在 azure devops & yaml lint 上遇到的错误
Other Errors
2 error(s), 0 warning(s)
/azure-pipelines-1.yml (Line: 2, Col: 1): A sequence was not expected
/azure-pipelines-1.yml: (Line: 13, Col: 1, Idx: 461) - (Line: 13, Col: 1, Idx: 461): While parsing a block collection, did not find expected '-' indicator.
It appears on YAML Lint the error is "fixed" when I add 3 spaces in front of line 2 but azure devops will still throw a related error for the same line but other column.它出现在 YAML Lint 上,当我在第 2 行前面添加 3 个空格时,错误是“已修复”,但 azure devops 仍会为同一行但其他列抛出相关错误。
Wondering if anyone has encountered this error before as I didn't really enter any YAML code myself, but used the editor + other GUI assistants within azure devops to create this想知道以前是否有人遇到过这个错误,因为我自己并没有真正输入任何 YAML 代码,而是使用 azure devops 中的编辑器 + 其他 GUI 助手来创建这个
Refer to the YAML documentation.请参阅 YAML 文档。 You have a
task
(ie the first thing in the file) outside of a scope in which it's valid, which would be under steps
.您在 scope之外有一个有效的
task
(即文件中的第一件事),该任务在steps
下。
The YAML editor does not guarantee syntactically valid YAML. YAML 编辑器不保证语法上有效的 YAML。 You're better off using a more robust editor like Visual Studio Code with the Azure Pipelines extension.
您最好使用更强大的编辑器,例如带有 Azure Pipelines 扩展的 Visual Studio Code。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.