Home > Software design >  While scanning a simple key, could not find expected ':'. Syntax error in azure-pipeline.y
While scanning a simple key, could not find expected ':'. Syntax error in azure-pipeline.y

Time:07-28

I am trying to execute an azure pipeline. It was executing fine. But when I added a task to conditionally check pom.xml file exists then only I need to execute that particular task, but it fails

enter image description here

Error

enter image description here

CodePudding user response:

Your script needs to be more indented:

- bash: |
    if [ -f Maven pom.xml ]; then
      echo "##vso[task.setVariable variable=FILEEXISTS]true"
    fi
- task: Maven@3
  etc

See an example here: https://stackoverflow.com/a/58555822/174843

  • Related