Azure DevOps管道失败:不应为序列



我对azure很陌生,所以如果这有点难以理解或不清楚,我很抱歉。我会尽力的。我正试图在管道任务中使用OWASP依赖性检查,用一个简单的React Web应用程序扫描漏洞。我从github导入了repo并成功地设置了管道(我相信(,但当我尝试添加OWASP依赖性检查时,运行失败并返回了Encountered error(s) while parsing pipeline YAML: /azure-pipelines.yml (Line: 2, Col: 1): A sequence was not expected /azure-pipelines.yml: (Line: 13, Col: 1, Idx: 427) - (Line: 13, Col: 1, Idx: 427): While scanning a simple key, could not find expected ':'.

作为参考,以下是azure-pipeline.yml的外观

# Node.js
- task: OWASPDependencyCheck@0
inputs:
outputDirectory: '$(Agent.TempDirectory)/dependency-scan-results'
scanDirectory: '$(Build.SourcesDirectory)'
outputFormat: 'ALL'
useSonarQubeIntegration: true
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://learn.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- master
pool:
vmImage: ubuntu-latest
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- script: |
npm install
npm run build
displayName: 'npm install and build'

老实说,我不知道该从这里走到哪里,也不知道我能提供什么其他信息来帮助解决这个问题,但如果有人有任何建议,我很乐意听取。

问题在于OWASPDependencyCheck@0.请把它放在台阶里面。

# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://learn.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- master
pool:
vmImage: ubuntu-latest
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
displayName: 'Install Node.js'
- script: |
npm install
npm run build
displayName: 'npm install and build'
- task: OWASPDependencyCheck@0
inputs:
outputDirectory: '$(Agent.TempDirectory)/dependency-scan-results'
scanDirectory: '$(Build.SourcesDirectory)'
outputFormat: 'ALL'
useSonarQubeIntegration: true

最新更新