The master branch has a folder that contains a loader (groovy) script which is run using a Jenkins pipeline.
sh """
set +x
export JAVA_OPTS='--illegal-access=deny'
source /var/lib/jenkins/.sdkman/bin/sdkman-init.sh
sdk install groovy || true
sdk use java 11.0.7.hs-adpt || true
cd jenkins/loader
groovy <script_name>
Part of the script is reproduced above. The last two lines is for navigating to the script folder in the master branch and executing the groovy script. The script loads some files from the master branch into the target environment. However, the requirement is to load the files from a release branch instead of master branch. How can this be achieved? Thanks