jenkins/update2head: skip push if nothing available to commit

BugzID_ 73789
Signed-off-by: Marc Mattmueller <marc.mattmueller@netmodule.com>
This commit is contained in:
Marc Mattmueller 2021-07-21 11:10:20 +02:00
parent 664c1f68d5
commit 154496719e
1 changed files with 5 additions and 0 deletions

View File

@ -107,5 +107,10 @@ def commitChanges(isNmUpdate, isCommunityUpdate) {
if(isCommunityUpdate) { updatedLayers += "community" }
sh(script: "git checkout ${env.BRANCH_NAME}")
sh(script: "git add -u")
stagedData = sh(returnStdout: true, script: "git diff --cached").trim()
if("${stagedData}" == "") {
println "everything up to date, nothing to commit"
return
}
sh(script: "git commit -m \"submodules: updated ${updatedLayers} hashes, triggered by ${env.TRIGGERED_USER}\" && git push")
}