microsoft / azure-pipelines-yaml

Azure Pipelines YAML examples, templates, and community interaction
MIT License
1.19k stars 924 forks source link

pipeline-triggers.md conflicts with the same information on docs.microsoft.com #560

Closed drtbz closed 2 years ago

drtbz commented 2 years ago

I'm trying to use PR triggers as per https://github.com/microsoft/azure-pipelines-yaml/blob/master/design/pipeline-triggers.md#schema-2

However it doesn't work. I'm using Azure Pipelines and Github. PR/CI workflow normally works when not called under resource.repositories

The docs.microsoft.com Schema for the same resource doesn't include the PR trigger:

https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/resources-repositories-repository?view=azure-pipelines

Can someone help me understand what's going on here and if PR triggers are possible as per pipeline-triggers.md please?

My pipeline code excerpt:

schedules:
- cron: '30 07 * * 1-5'
  always: true
  branches:
    include:
    - master
    - main
  displayName: pipelineName

resources:
  repositories:
  - repository: repo-name
    type: github
    endpoint: repo-endpoint
    name: full-repo-name
    pr:
      drafts: false
      branches:
        include:
        - '*'
        exclude:
        - main
        - master      
      paths:
        include:
        - 'folder/*'
        exclude:
        - 'folder/README.md'
denis-tikhomirov commented 2 years ago

@TomBailey-N, Thanks for the issue-reporting in this repository, currently we are under issues with higher priority, we will take a look at this ticket once we will have enough capacity.

denis-tikhomirov commented 2 years ago

@TomBailey-N, I see that you mentioned doc https://github.com/microsoft/azure-pipelines-yaml/blob/master/design/pipeline-triggers.md from design directory of the repo. But it's design docs, and the docs can be not up-to-date in some cases, please find the info in README.md for the directory.

Most actual guide is placed in docs.microsoft.com - https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops&tabs=yaml#pr-triggers. Please use the guide as up-to-date version.

Regarding PR triggers using - really the triggers must be specified for pipeline, not under resource.repositories. Please find examples in guides provided above.