Added error handling for git config

This commit is contained in:
Daniel Weissmall 2023-12-04 15:08:56 +03:00
parent 9c8cbb9e63
commit 0e28922491

View File

@ -44,8 +44,9 @@ def withGiteaCreds(String credentialsId, String gitToolName, Closure body) {
gitToolName: gitToolName gitToolName: gitToolName
) )
]) { ]) {
sh "git config user.name ${env.GIT_USERNAME}" errorMessage = "Unable to set git config"
sh "git config user.email admin@dipal.ru" sh "git config user.name ${env.GIT_USERNAME} || echo $errorMessage"
sh "git config user.email admin@dipal.ru || echo $errorMessage"
body() body()
} }
} }