I want to modify this existing pipeline (which publishes to a test server) to only get files modified on the current branch. The issue I’m running into right now, is if one person pushes to branch A and the other to branch B, the pipeline overwrites all of the files with files from branch B, regardless of whether or not they were actually modified. I tried updating the checkout to fetchDepth: 0
, but this didn’t work.
<code>trigger:
branches:
include:
- '*'
exclude:
- main
pool:
name: 'Default'
demands:
- agent.os -equals Windows_NT # Optional: Ensure it runs on Windows-based agents
steps:
- checkout: self
- task: WindowsMachineFileCopy@2
inputs:
SourcePath: '$(Build.Repository.LocalPath)'
MachineNames: 'SERVER0TST'
AdminUserName: 'ntdomainuser'
AdminPassword: '$(user_password)'
TargetPath: 'c:inetpubwwwroot'
</code>
<code>trigger:
branches:
include:
- '*'
exclude:
- main
pool:
name: 'Default'
demands:
- agent.os -equals Windows_NT # Optional: Ensure it runs on Windows-based agents
steps:
- checkout: self
- task: WindowsMachineFileCopy@2
inputs:
SourcePath: '$(Build.Repository.LocalPath)'
MachineNames: 'SERVER0TST'
AdminUserName: 'ntdomainuser'
AdminPassword: '$(user_password)'
TargetPath: 'c:inetpubwwwroot'
</code>
trigger:
branches:
include:
- '*'
exclude:
- main
pool:
name: 'Default'
demands:
- agent.os -equals Windows_NT # Optional: Ensure it runs on Windows-based agents
steps:
- checkout: self
- task: WindowsMachineFileCopy@2
inputs:
SourcePath: '$(Build.Repository.LocalPath)'
MachineNames: 'SERVER0TST'
AdminUserName: 'ntdomainuser'
AdminPassword: '$(user_password)'
TargetPath: 'c:inetpubwwwroot'