Added Git Code to Make a Safe Directory

This commit is contained in:
Nicole Rappe 2024-05-05 09:06:52 -06:00
parent 54bea5c6b0
commit b9d1c8d2e3

View File

@ -5,6 +5,9 @@ process_repo() {
FULL_REPO_URL=$1 FULL_REPO_URL=$1
DESTINATION=$2 DESTINATION=$2
# Ensure The Repo is marked as Safe by Git
git config --global --add safe.directory /root/Repo_Cache/docs
# Extract the URL without credentials for logging and notifications # Extract the URL without credentials for logging and notifications
CLEAN_REPO_URL=$(echo "$FULL_REPO_URL" | sed 's/https:\/\/[^@]*@/https:\/\//') CLEAN_REPO_URL=$(echo "$FULL_REPO_URL" | sed 's/https:\/\/[^@]*@/https:\/\//')
@ -34,6 +37,7 @@ process_repo() {
# Main loop # Main loop
while true; do while true; do
# Iterate over each environment variable matching 'REPO_[0-9]+' # Iterate over each environment variable matching 'REPO_[0-9]+'
env | grep '^REPO_[0-9]\+=' | while IFS='=' read -r name value; do env | grep '^REPO_[0-9]\+=' | while IFS='=' read -r name value; do
# Split the value by comma and read into separate variables # Split the value by comma and read into separate variables