From 94e70f355547ccf7f086473ae003c72c6b258690 Mon Sep 17 00:00:00 2001 From: Peter Sutter Date: Mon, 28 Oct 2024 15:30:53 +0100 Subject: [PATCH] Conditionally set git user --- .ci/verify | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.ci/verify b/.ci/verify index a360b40..960eaac 100755 --- a/.ci/verify +++ b/.ci/verify @@ -17,8 +17,19 @@ export SOURCE_PATH="$(readlink -f "$SOURCE_PATH")" pushd "${SOURCE_PATH}" > /dev/null -git config --global user.email "gardener@sap.com" -git config --global user.name "Gardener CI/CD" +if [[ -z "$(git config --global user.email)" ]]; then + echo "Setting global Git user.email to gardener@sap.com" + git config --global user.email "gardener@sap.com" +else + echo "Global Git user.email is already set to $(git config --global user.email)" +fi + +if [[ -z "$(git config --global user.name)" ]]; then + echo "Setting global Git user.name to Gardener CI/CD" + git config --global user.name "Gardener CI/CD" +else + echo "Global Git user.name is already set to $(git config --global user.name)" +fi export GOLANGCI_LINT_ADDITIONAL_FLAGS="--verbose --timeout 2m" export GO_TEST_ADDITIONAL_FLAGS="-race"