How to escape whitespace in Azure Pipelines include / exclude paths?

Copper Contributor

Hey,

 

I want to exclude some folders that have whitespace in the name when running the pipeline. I went through this doc File matching patterns reference - Azure Pipelines | Microsoft Learn and I did not find any example. I tried multiple combinations, but none worked.

 

What is the correct syntax to do that for line 10 and 12?

 

trigger:
    branches:
      include:
        - dev
        - main
    paths:
     exclude:
      - Automation
      - Backup/*
      - Disaster Recovery/*
      - Inventory/*
      - security/Access Policies/*
     include:
      - Automation/xyz/*

 

 

Thank you.

2 Replies
Just running into this today. Did you ever solve this? Seems like the DevOps YAML editor is looking to match a regex and throws this error: String does not match the pattern of "^[^\/~\^\: \[\]\\]+(\/[^\/~\^\: \[\]\\]+)*$".

Okay, answering my own question after some testing. It appears the error in the YAML editor is incorrect. Though it shows the squiggly line, it does indeed validate and execute as expected by simply enclosing it in single quotes:

weekendclimber_0-1695916516012.png