I'm trying to set up job runnig tests on code that is changed in Pull Request.
I have VSC trigger, Pull Requests and Commit Status Publisher set up.
When PR is raised job is triggered and results are published in github - so far so good.
I want to check only files that has changed - i use system.teamcity.build.changedFiles.file to determine them.
Now issues starts.
I have found few ways to walkaround such checks.
First - this file is not present if you rerun job. So if your checks have failed just goto TC and rerun job - will end with success (*depends on job setup).
Adding extra step that checks if changedFiles file is empty can prevent such scenario.
Second - changedFiles file does not contain files that are changed across PR but only from last commit.
That means that you can circumvent checks by making change in one file within pull request AFTER PR checks have been done.
This will once again trigger job that will validate only that one file instead of all files that are changed across PR.
As far as files in workdir are not git clones I am unable to run git diff.
What are my options to determine which files are changed in given PR?