Skip to content

Commit

Permalink
✅ chore: the git validation was added
Browse files Browse the repository at this point in the history
  • Loading branch information
futjesus committed Dec 17, 2024
1 parent 123b323 commit d0a1b7b
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions cypress/utils/github/shell/git-commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,30 @@ clone_repository() {
rm -rf "gitops"
fi


echo "Setting git configuration..."
git config --global user.name "$git_owner"
git config --global user.email "[email protected]"
DEFAULT_NAME=$git_owner
DEFAULT_EMAIL="[email protected]"

USER_NAME=$(git config --global --get user.name)

if [ -z "$USER_NAME" ]; then
echo "No se encontró 'user.name'. Configurando el valor por defecto..."
git config --global user.name "$DEFAULT_NAME"
echo "'user.name' configurado como: $DEFAULT_NAME"
else
echo "'user.name' ya está configurado como: $USER_NAME"
fi

USER_EMAIL=$(git config --global --get user.email)

if [ -z "$USER_EMAIL" ]; then
echo "No se encontró 'user.email'. Configurando el valor por defecto..."
git config --global user.email "$DEFAULT_EMAIL"
echo "'user.email' configurado como: $DEFAULT_EMAIL"
else
echo "'user.email' ya está configurado como: $USER_EMAIL"
fi

echo "Cloning repository..."
gh repo clone "$url" gitops
Expand Down

0 comments on commit d0a1b7b

Please sign in to comment.