Created
August 11, 2020 23:04
-
-
Save marcel-dias/bbdc5afec6c162d6bcaebbbe2ae5b74a to your computer and use it in GitHub Desktop.
jenkinsfile-changed-files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@NonCPS | |
String getChangedFiles() { | |
changedFiles = [] | |
for (changeLogSet in currentBuild.changeSets) { | |
for (entry in changeLogSet.getItems()) { | |
for (file in entry.getAffectedFiles()) { | |
changedFiles.add(file.getPath()) | |
} | |
} | |
} | |
return changedFiles.join(",") | |
} | |
@NonCPS | |
def getChangedPaths() { | |
changedPaths = [] | |
for (changeLogSet in currentBuild.changeSets) { | |
for (entry in changeLogSet.getItems()) { | |
changedPaths.addAll(entry.getAffectedPaths()) | |
} | |
} | |
return changedPaths.join(",") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment