Search code examples
azure-devopstriggersazure-pipelines

pipeline trigger paths filter error: Unexpected value 'paths'


Trying an example to trigger a pipeline using path filters.

trigger: none

resources:
  pipelines:
  - pipeline: parentpipeline
    source: 'parent-pipeline' 
    trigger:
      branches:
        include:
        - main
      paths:
        include:
        - scripts/*

stages:
- stage: A
  jobs:
  - job: A1  
    pool:
      vmImage: ubuntu-latest
    steps:
    - script: echo Hello, world!
      displayName: 'Run a one-line script'

I have a following folder structure in a sample repo, and paths filter throwing an error /pipeline-depenedent.yml (Line: 16, Col: 7): Unexpected value 'paths' enter image description here

tried wrapping include value text around quotes, with and without branches filter. Can't understand what's wrong in the template above


Solution

  • It is not supported on this level:

      paths:
        include:
        - scripts/*
    

    Check this link for the trigger: resources.pipelines.pipeline.trigger definition

    enabled boolean.

    Whether the trigger is enabled; defaults to true.

    branches resources.pipelines.pipeline.trigger.branches.

    Branch names to include or exclude for triggering a run.

    stages string list.

    List of stages that when matched will trigger the pipeline.

    tags string list.

    List of tags that when matched will trigger the pipeline.