From 154496719e42ec319c6b5b0e5e55e70f7bc4ed5d Mon Sep 17 00:00:00 2001 From: Marc Mattmueller Date: Wed, 21 Jul 2021 11:10:20 +0200 Subject: [PATCH] jenkins/update2head: skip push if nothing available to commit BugzID_ 73789 Signed-off-by: Marc Mattmueller --- Jenkinsfile_update2head | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Jenkinsfile_update2head b/Jenkinsfile_update2head index 35251ae..7e4021e 100644 --- a/Jenkinsfile_update2head +++ b/Jenkinsfile_update2head @@ -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") }