Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I exclude changes to the pipeline yaml file to trigger a build i azure devops?

Working with Azure devops, and piplines yaml files. There is a trigger on the develop branch. However, when I am saving changes to the yaml file, it triggers a new build.

This happens cause the change to the yaml file is a new commit, captured by the trigger.

So my question is, how can I exclude changes to the yaml file, from triggering a new build?

like image 502
sirpadk Avatar asked Jun 03 '20 12:06

sirpadk


People also ask

How do you trigger release pipeline from build pipeline Azure Devops?

Stages filters for pipeline resource triggers requires Azure DevOps Server 2020 Update 1 or greater. You can trigger your pipeline when one or more stages of the triggering pipeline complete by using the stages filter. If you provide multiple stages, the triggered pipeline runs when all of the listed stages complete.

What is trigger in Azure pipeline YAML?

Scheduled release triggers allow you to run a release pipeline according to a schedule. Pull request release triggers are used to deploy a pull request directly using classic releases. Stage triggers in classic release are used to configure how each stage in a classic release is triggered.

How do I edit YAML file in Azure Devops pipeline?

Edit a YAML pipeline Sign in to your organization ( https://dev.azure.com/{yourorganization} ). Select your project, choose Pipelines > Pipelines, and then select the pipeline you want to edit. Choose Edit. Make edits to your pipeline using Intellisense keyboard shortcuts and the task assistant for guidance.


1 Answers

With changes announced here Support for wild cards in path filters we can now use wild cards:

Wild cards can be used when specifying inclusion and exclusion branches for CI or PR triggers in a pipeline YAML file. However, they cannot be used when specifying path filters. For instance, you cannot include all paths that match src/app//myapp*. This has been pointed out as an inconvenience by several customers. This update fills this gap. Now, you can use wild card characters (, *, or ?) when specifying path filters.

So you can now:

# specific path build
trigger:
  branches:
    include:
    - master
    - releases/*
  paths:
    include:
    - '*'
    exclude:
    - '**/*.yml'
    - '**/*.yaml'
like image 130
Krzysztof Madej Avatar answered Sep 20 '22 05:09

Krzysztof Madej