| 1234567891011121314151617181920212223242526272829 |
- def processString(String content) {
- return content
- }
- @NonCPS
- def collectChangeInfo() {
- // 配置文件扩展名正则匹配
- def configFilePatterns = ~/.*[\\/]*[^\\/]*\.(yaml|yml|ini|groovy)$/
-
- // 存储最后一个符合条件的变更
- def lastCodeChange = ""
-
- def changeLogSets = currentBuild.changeSets
- changeLogSets.each { changeSet ->
- changeSet.items.each { entry ->
- // 检查是否有非配置文件的变更
- def isCodeChange = entry.affectedFiles.any { file ->
- !(file.path ==~ configFilePatterns)
- }
-
- if (isCodeChange) {
- lastCodeChange += "Commit ${entry.commitId.substring(0, 8)} by ${entry.author} Info"
- lastCodeChange += "${entry.msg}\n"
- }
- }
- }
- return lastCodeChange ? lastCodeChange.trim() : "No valid code changes found."
- }
- return this
|