Jenkinsfile_update2head: checkout branch before committing

the job is performing a swallowed checkout which leads to a
detached HEAD. Thus the branch need to be checked out before
committing and pushing

BugzID: 74574
Signed-off-by: Marc Mattmueller <marc.mattmueller@netmodule.com>
This commit is contained in:
Marc Mattmueller 2021-07-06 16:41:44 +02:00
parent 24866de9a0
commit bf7d5e86a4
1 changed files with 1 additions and 0 deletions

View File

@ -100,6 +100,7 @@ def commitChanges(isNmUpdate, isCommunityUpdate) {
if(isNmUpdate) { updatedLayers += "netmodule"}
if(isNmUpdate && isCommunityUpdate) { updatedLayers += " and " }
if(isCommunityUpdate) { updatedLayers += "community" }
sh(script: "git checkout ${env.BRANCH_NAME}")
sh(script: "git add -u")
sh(script: "git commit -m \"submodules: updated ${updatedLayers} hashes, triggered by ${env.TRIGGERED_USER}\" && git push")
}