Home > OS >  Get which file trigger a CI pipeline
Get which file trigger a CI pipeline

Time:03-30

I have a repo which contains a lot of service code, which share one build pipeline. We want to add some tags on each build so that we can tell which service change this build contains. I came up with solution of using git diff between HEAD and forked commit on master branch so that we can tell changed file scope. But it seems to need to checkout whole repo to achieve the goal, which is not efficient. (Correct me if I am wrong.) So I am wondering if there is a way to get the diff directly from azure devops trigger?

CodePudding user response:

I don't think the trigger itself passes that information through any variables but the rest api has a diffs method which you can query.

Documentation: enter image description here

In the log of the build:

enter image description here

  • Related