Replies: 1 comment
-
I had the same problem - found the solution here: I think that the solution in the article might have another disadvantage - it only works on changes from the last commit, but if someone doesn't choose to squash the commits when completing a pull request, multiple commits are added to the master branch and files_changed job might miss changes. I ran into another solution to this issue, but it looks much more complex and I'm unsure how to apply it. https://stackoverflow.com/questions/61468949/run-azure-pipelines-job-only-when-certain-files-are-changed |
Beta Was this translation helpful? Give feedback.
-
Hi,
I tried your solution described in the post at the following link
https://www.codewrecks.com/post/azdo/pipeline/execution-condition-file-changed/
Unfortunately in my test it fails at the command
$changedFiles = git diff --name-status HEAD HEAD^
with the following error message:
fatal: ambiguous argument 'HEAD^': unknown revision or path not in the working tree. Use '--' to separate paths from revisions, like this: 'git <command> [<revision>...] -- [<file>...]' vso[task.setvariable variable=BaseApp;isOutput=true;]False
Looking on Google seems the issue is that the command cannot see previous commits, any idea how I can test if there are commits before to run this command? I tried also to use a Try Catch approach but it did not work.
Thnak you in advance for you support
Eclipses
Beta Was this translation helpful? Give feedback.
All reactions