From d4112e5a74588cc09d61ba3c50c78e5302f155d7 Mon Sep 17 00:00:00 2001 From: codex Date: Sun, 19 Apr 2026 22:58:58 -0300 Subject: [PATCH] ci(titan-iac): guard promote stage when workspace lacks .git --- Jenkinsfile | 5 +++++ ci/Jenkinsfile.titan-iac | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index 2913196d..32a9c249 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -274,6 +274,11 @@ PY withCredentials([usernamePassword(credentialsId: 'gitea-pat', usernameVariable: 'GIT_USER', passwordVariable: 'GIT_TOKEN')]) { sh ''' set +x + cd "${WORKSPACE}" + if [ ! -d .git ]; then + echo "workspace is not a git checkout; skipping promote" + exit 0 + fi git config user.email "jenkins@bstein.dev" git config user.name "jenkins" git remote set-url origin https://${GIT_USER}:${GIT_TOKEN}@scm.bstein.dev/bstein/titan-iac.git diff --git a/ci/Jenkinsfile.titan-iac b/ci/Jenkinsfile.titan-iac index 84e22242..aa435064 100644 --- a/ci/Jenkinsfile.titan-iac +++ b/ci/Jenkinsfile.titan-iac @@ -273,6 +273,11 @@ PY withCredentials([usernamePassword(credentialsId: 'gitea-pat', usernameVariable: 'GIT_USER', passwordVariable: 'GIT_TOKEN')]) { sh ''' set +x + cd "${WORKSPACE}" + if [ ! -d .git ]; then + echo "workspace is not a git checkout; skipping promote" + exit 0 + fi git config user.email "jenkins@bstein.dev" git config user.name "jenkins" git remote set-url origin https://${GIT_USER}:${GIT_TOKEN}@scm.bstein.dev/bstein/titan-iac.git