admin管理员组

文章数量:1122846

Trying to create a yaml file for delta build deployment using Changedfiles task. It doesnt work as expected. can someone help me in creating delta build deployment. In rules i have given path only for one java file. The has changed variable should be true only the given java file changed. But Has changed variable is getting true , if any file changed in the repository. In checkchanges, it is picking all files in the repository.

The ChangedFiles@1 task is indeed not a built-in Azure DevOps pipeline task. It is part of a third-party extension called "Changed files" available on the Azure DevOps Marketplace. You can find the extension here marketplace.visualstudio/…

The pipeline is configured to run on a single branch. The file we are trying to detect changes after the last successful build of this pipeline.

Please share if anyone has an alternative option to create a pipeline for delta changes for delta build deployment.

  - task: ChangedFiles@1
    name: CheckChanges
    inputs:
      rules: 'Customization/Services/ematrix/src/com/dassault_systemes/ecl/default_Attributes/DefaultAttributes.java'
      variable: HasChanged
      cwd: $(System.DefaultWorkingDirectory)
      verbose: true

Trying to create a yaml file for delta build deployment using Changedfiles task. It doesnt work as expected. can someone help me in creating delta build deployment. In rules i have given path only for one java file. The has changed variable should be true only the given java file changed. But Has changed variable is getting true , if any file changed in the repository. In checkchanges, it is picking all files in the repository.

The ChangedFiles@1 task is indeed not a built-in Azure DevOps pipeline task. It is part of a third-party extension called "Changed files" available on the Azure DevOps Marketplace. You can find the extension here marketplace.visualstudio.com/…

The pipeline is configured to run on a single branch. The file we are trying to detect changes after the last successful build of this pipeline.

Please share if anyone has an alternative option to create a pipeline for delta changes for delta build deployment.

  - task: ChangedFiles@1
    name: CheckChanges
    inputs:
      rules: 'Customization/Services/ematrix/src/com/dassault_systemes/ecl/default_Attributes/DefaultAttributes.java'
      variable: HasChanged
      cwd: $(System.DefaultWorkingDirectory)
      verbose: true
Share Improve this question asked Nov 21, 2024 at 10:21 Lavanya BLavanya B 14 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 0

The tool uses git diff command: https://github.com/touchifyapp/vsts-changed-files/blob/master/changed-files/lib/git-diff.ts

I think you should checkout your repo with fetchDepth: 0 to get the history on the build agent: Shallow fetch, Troubleshooting

The ChangedFiles task internally uses the Get Build Changes API to figure out the commit Ids pf the changes. According to a Microsoft employee (reference) this API:

computes new commits since the last successful build on the same branch

Given you say that the file you're trying to match has changed after the last successful build of the pipeline the commit where it is changed is included in the changes which is why the variable is set to true.

So the issue here is that you haven't defined the meaning of "changed" well enough. If you're trying to compare if the file has changed with respect to a specific branch you can set the refBranch input to the task and then it will compare it against that specific branch.

本文标签: ChangedFiles task in Azure pipelines detects changes in files that aren39t selectedStack Overflow