From ea9f8508de153ea34d179740b205f6f3236729ff Mon Sep 17 00:00:00 2001 From: jstastny-cz Date: Thu, 14 Dec 2023 11:41:13 +0100 Subject: [PATCH] kie-issues#767: set user config for git --- .ci/jenkins/Jenkinsfile.deploy | 2 +- .ci/jenkins/Jenkinsfile.setup-branch | 3 ++- .ci/jenkins/project/Jenkinsfile.post-release | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.ci/jenkins/Jenkinsfile.deploy b/.ci/jenkins/Jenkinsfile.deploy index 1b3addc2e4d..cb3d8f2a83e 100644 --- a/.ci/jenkins/Jenkinsfile.deploy +++ b/.ci/jenkins/Jenkinsfile.deploy @@ -194,7 +194,7 @@ void checkoutRepo() { void commitAndCreatePR() { def commitMsg = "[${getBuildBranch()}] Update version to ${getProjectVersion()}" def prBody = "Generated by build ${BUILD_TAG}: ${BUILD_URL}.\nPlease do not merge, it should be merged automatically." - + githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId()) githubscm.commitChanges(commitMsg, { githubscm.findAndStageNotIgnoredFiles('pom.xml') githubscm.findAndStageNotIgnoredFiles('antora.yml') diff --git a/.ci/jenkins/Jenkinsfile.setup-branch b/.ci/jenkins/Jenkinsfile.setup-branch index 00174a9ee24..bc492e2f75d 100644 --- a/.ci/jenkins/Jenkinsfile.setup-branch +++ b/.ci/jenkins/Jenkinsfile.setup-branch @@ -58,7 +58,7 @@ pipeline { dir(getRepoName()) { if (githubscm.isThereAnyChanges()) { def commitMsg = "Update version to ${getDroolsVersion()}" - + githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId()) githubscm.commitChanges(commitMsg, { githubscm.findAndStageNotIgnoredFiles('pom.xml') githubscm.findAndStageNotIgnoredFiles('antora.yml') @@ -146,6 +146,7 @@ boolean isMainBranch() { String commitAndCreatePR(String commitMsg, String localBranch, String targetBranch) { def prBody = "Generated by build ${BUILD_TAG}: ${BUILD_URL}" + githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId()) githubscm.commitChanges(commitMsg) githubscm.pushObject('origin', localBranch, getGitAuthorPushCredsId()) return githubscm.createPR(commitMsg, prBody, targetBranch, getGitAuthorCredsId()) diff --git a/.ci/jenkins/project/Jenkinsfile.post-release b/.ci/jenkins/project/Jenkinsfile.post-release index 16fd4f475ff..5bfbe78ac3a 100644 --- a/.ci/jenkins/project/Jenkinsfile.post-release +++ b/.ci/jenkins/project/Jenkinsfile.post-release @@ -123,7 +123,7 @@ void mergeAndPush(String prLink, String targetBranch) { String commitAndCreatePR(String commitMsg, String localBranch, String targetBranch) { def prBody = "Generated by build ${BUILD_TAG}: ${BUILD_URL}" - + githubscm.setUserConfigFromCreds(getGitAuthorPushCredsId()) githubscm.commitChanges(commitMsg) githubscm.pushObject('origin', localBranch, getGitAuthorPushCredsId()) return githubscm.createPR(commitMsg, prBody, targetBranch, getGitAuthorCredsId())