add support for non-github repos
All checks were successful
Docker Build Smart Logic / Build amd64 & arm64 (push) Successful in 17s

This commit is contained in:
2026-02-08 14:10:43 +01:00
parent 953ed46e8c
commit 1848e28bed
2 changed files with 21 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
FROM alpine:latest
# Abhängigkeiten installieren
RUN apk add --no-cache bash curl jq msmtp ca-certificates tzdata
RUN apk add --no-cache bash curl jq msmtp ca-certificates tzdata git
# Struktur anlegen
RUN mkdir /app /config

View File

@@ -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