I am out of my league here so forgive me if this is hard to understand. What I am trying to accomplish is to check if any files have changed in a certain directory during a pull request in my Jenkinsfile setup. If there are files that have changed compared to the develop branch, I would like to run the particular stage. This is a declarative pipeline. Let me give you example:
stage('Publish Common Module') {
when {
// can I check if projects/common/ has any files that are different compared to develop?
// if so, then I want to run the steps in this stage
}
}
I am not sure if that gives enough background as to what I am trying to accomplish. The reason for this setup is that there are multiple stages that build a module based on if there are changes in the PR for that module.
Apologies if this is not enough information to get an accurate answer.