add support for non-github repos
All checks were successful
Docker Build Smart Logic / Build amd64 & arm64 (push) Successful in 17s
All checks were successful
Docker Build Smart Logic / Build amd64 & arm64 (push) Successful in 17s
This commit is contained in:
@@ -69,8 +69,26 @@ EOF
|
||||
NEW_VAL=$(echo "$RESPONSE" | grep -i "docker-content-digest" | awk '{print $2}' | tr -d '\r')
|
||||
[[ -z "$NEW_VAL" ]] && NEW_VAL=$(echo "$RESPONSE" | grep -i "etag" | awk '{print $2}' | tr -d '\r' | tr -d '"')
|
||||
fi
|
||||
elif [ "$TYPE" == "GITHUB" ]; then
|
||||
NEW_VAL=$(curl -s "https://api.github.com/repos/${REPO}/branches/${EXTRA}" | jq -r '.commit.sha // empty')
|
||||
elif [ "$TYPE" == "GITHUB" ] || [ "$TYPE" == "GIT" ]; then
|
||||
if [[ "$REPO" =~ ^http ]] || [[ "$REPO" == *"."* ]]; then
|
||||
# FALL: Eigener Git-Server (Gitea, GitLab, etc.)
|
||||
URL="$REPO"
|
||||
[[ ! "$URL" =~ ^http ]] && URL="https://$URL"
|
||||
|
||||
echo " 🔍 Frage Git-Remote ab: $URL ($EXTRA)..."
|
||||
|
||||
# GIT_TERMINAL_PROMPT=0 verhindert das Warten auf Passworteingaben
|
||||
# timeout 15s verhindert das Hängenbleiben bei toten Servern
|
||||
NEW_VAL=$(GIT_TERMINAL_PROMPT=0 timeout 15s git ls-remote "$URL" "refs/heads/$EXTRA" 2>/dev/null | awk '{print $1}')
|
||||
|
||||
if [ $? -ne 0 ] || [ -z "$NEW_VAL" ]; then
|
||||
echo " ⚠️ Fehler: Git-Server nicht erreichbar oder Repo privat/geschützt."
|
||||
continue
|
||||
fi
|
||||
else
|
||||
# FALL: Klassisches GitHub Repo via API
|
||||
NEW_VAL=$(curl -s --max-time 15 "https://api.github.com/repos/${REPO}/branches/${EXTRA}" | jq -r '.commit.sha // empty')
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$NEW_VAL" ] || [ "$NEW_VAL" == "null" ]; then
|
||||
|
||||
Reference in New Issue
Block a user