From e675a6699ee0a49b7b5d3308b37d9261d4538816 Mon Sep 17 00:00:00 2001 From: Hweinstock Date: Wed, 10 Jun 2026 13:47:33 +0000 Subject: [PATCH] fix(scripts): avoid overwriting git local config in e2e script --- scripts/run-e2e-local.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/run-e2e-local.sh b/scripts/run-e2e-local.sh index 3c4d619fe..9350b6c06 100755 --- a/scripts/run-e2e-local.sh +++ b/scripts/run-e2e-local.sh @@ -88,12 +88,22 @@ echo "=== Setting AWS account env var ===" export AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text) echo "✅ AWS_ACCOUNT_ID=$AWS_ACCOUNT_ID AWS_REGION=$AWS_REGION" -echo "=== Configuring git (required for agentcore create) ===" -git config --global user.email "ci@local" 2>/dev/null || true -git config --global user.name "Local E2E" 2>/dev/null || true - cd "$REPO_ROOT" +echo "=== Verifying git is configured (required for agentcore create) ===" +git_email="$(git config --global user.email || true)" +git_name="$(git config --global user.name || true)" + +if [ -z "$git_email" ] || [ -z "$git_name" ]; then + echo "ERROR: git is not configured. 'agentcore create' requires a global git identity." >&2 + echo "Set it with:" >&2 + echo " git config --global user.email \"you@example.com\"" >&2 + echo " git config --global user.name \"Your Name\"" >&2 + exit 1 +fi + +echo "git configured as: $git_name <$git_email>" + echo "=== Installing dependencies ===" npm ci