Updated answer:
According to this document: https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema/resources-repositories-repository?view=azure-pipelines#properties
Repository resource triggers are supported only for Azure Repos Git repositories.
Repository resource triggers (resources: repositories: … trigger:) are supported only for Azure Repos Git repositories and do not work for GitHub repository resources. So even though your service connection is authorized, the organization mapping is correct, and GitHub webhooks exist, Azure DevOps will ignore the resources.repositories.trigger block when type: github is used
You can try using below workarounds:
Use a “triggering” pipeline that is directly connected to GitHub, then trigger your main pipeline using a pipeline completion trigger (recommended workaround) Pipeline completion triggers are the supported way to automatically run one pipeline after another finishes.
- Create Pipeline A (GitHub-CI) in Azure DevOps but select GitHub repo as the pipeline repository (so CI triggers are supported natively for GitHub).
- Then configure Pipeline B (your existing pipeline where YAML is stored in ADO) to run when Pipeline A completes using
resources: pipelines:
Pipeline A (GitHub-CI) – runs on GitHub pushes:
YAML
trigger:
branches:
include:
- 'Test#Sprint2'
pool:
vmImage: ubuntu-latest
steps:
- script: echo "GitHub change detected. Down
Pipeline B (Main pipeline) – triggered by completion of Pipeline A:
YAML
trigger: none
resources:
pipelines:
- pipeline: githubci
source: GitHub-CI # exact name of Pipeline A in Azure DevOps
trigger: true
steps:
- script: echo "Main pipeline running after GitHub-C
Don’t rely on resources.repositories.trigger for GitHub repos (it won’t fire) Even if your YAML is syntactically correct, GitHub repository resources cannot trigger pipelines via resources.repositories.trigger because Microsoft’s schema notes it is supported only for Azure Repos Git repositories.
Ensure Azure DevOps UI settings are not overriding your YAML triggers Azure DevOps allows trigger settings in the UI to override YAML trigger configuration. If triggers don’t fire as expected, check pipeline Edit → Triggers and verify that “Override the YAML trigger from here” isn’t enabled for CI/PR triggers.
and click on Yes for was this answer helpful or click on Recommend this answer. And, if you have any further query do let us know.