-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✅ chore: the git validation was added
- Loading branch information
Showing
1 changed file
with
23 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|