Am looking for a solution where I can get change set of current build from last successful build.
We are using git hub as SCM
I want to get the change set redirected to a text file, where I can further perform operations on the change set content
I tried git diff --name-only $GIT_COMMIT $GIT_PREVIOUS_COMMIT
but of no use. Its ending up with error can not access commit id.
For your use case, you can use Jenkins global variables. To retrieve the changed files from current build you can use this one:
currentBuild.changeSets
To do the same but for the previous build:
currentBuild.previousBuild.changeSets
The full reference is here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With