Issue
I currently set up Jenkins and GitHub so that when a push is sent to GitHub a build is automatically triggered. Is there a way to get the name of the file that causes the build. For example, if I have a file in GitHub named test.txt in a repo called TestRepo and I commit a change in test.txt, how could I figure out the build was caused by a change in test.txt and not due to another file in the repo.
Solution
Assuming you are using the GitHub plugin for polling, the build will be triggered by a commit/s not by a specific file. You can see the changes log directly in Jenkins in 'Changes' tab or if you need to get the list of files in the pipeline you can try to have a step with something like 'git diff --name-only $GIT_PREVIOUS_COMMIT $GIT_COMMIT' after the checkout step.
Answered By - IonutS
Answer Checked By - Cary Denson (JavaFixing Admin)