azure-devopstriggerscontinuous-deployment

Azure DevOps: Continuous Deployment Trigger Exclusion for 'refs/pull/' Prevents Releases in 'feature/' Branches


I am configuring a Continuous Deployment (CD) trigger in Azure DevOps and need to exclude pull request branches (refs/pull/) from triggering new releases. However, after applying this exclusion, new releases are also not being triggered for branches matching feature/.

My current setup: I added refs/pull/* to the exclusions to prevent deployments from PR-related branches. After this change, releases no longer trigger for feature/* branches, even though they should. What I expected: Excluding refs/pull/* should prevent releases from PRs. feature/* branches should still trigger new releases as expected. Question: Is there a known issue with excluding refs/pull/* affecting other branch patterns? How can I properly exclude pull request branches without impacting feature/* triggers? Any insights or alternative configurations would be appreciated!


Solution

  • I attempted with the same configuration of CD trigger (Continuous deployment trigger), and it can only prevent the builds of pull request branches (refs/pull/*) from triggering new releases. For other branches, the new releases can be triggered as expected.

    Build branch filters:
    Exclude refs/pull/*
    

    enter image description here


    For your case:

    1. If you want the new releases can be triggered only for the builds of branches under the feature/ folder, you can set the CD trigger like as below.

      Build branch filters:
      Include feature/*
      

      enter image description here

    2. If you want the new releases can be triggered for the builds of any branches except pull request branches, you can set the CD trigger like as below.

      Build branch filters:
      Include *
      Exclude refs/pull/*
      

      enter image description here

    I have tested above ways, all of them can trigger new releases for branches feature/*, and not trigger for pull request branches.