We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eec9e7f commit d043c41Copy full SHA for d043c41
scripts/check-repo.sh
@@ -20,6 +20,20 @@ if ! command -v git &>/dev/null; then
20
throw "git not installed."
21
fi
22
23
+# Retrieve git email.
24
+GIT_EMAIL=$(git config user.email)
25
+
26
+# Check if email is set.
27
+if [ -z "$GIT_EMAIL" ]; then
28
+ throw "Git email is not set."
29
+fi
30
31
+# Validate email using a regex.
32
+# This regex matches a basic email pattern.
33
+if ! [[ "$GIT_EMAIL" =~ ^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$ ]]; then
34
+ throw "Git email '$GIT_EMAIL' is not valid."
35
36
37
# 1. Sleep for a random number of milliseconds
38
# The time interval is important to reduce unintended network traffic.
39
((CURRENT_STEP++))
0 commit comments