Nehad Hazem
Nehad Hazem

Reputation: 11

Azure CI/CD trigger pipeline based on specific file

I have CI/CD related question

I created a release pipeline that copies one file to Azure blob and it's working fine.

It's getting triggered every time a change is merged to the main/master branch.

Question is, is there a way to only trigger it if the merged changes contain a specific file? just to avoid over triggering

Upvotes: 0

Views: 1493

Answers (1)

WaitingForGuacamole
WaitingForGuacamole

Reputation: 4301

For a YAML-based pipeline, the documentation (currently at https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/azure-repos-git?view=azure-devops&tabs=yaml) suggests that "you can specify file paths to include or exclude", with the example

# specific path build
trigger:
  branches:
    include:
    - master
    - releases/*
  paths:
    include:
    - docs
    exclude:
    - docs/README.md

Upvotes: 1

Related Questions