Remove diagnostic steps for registry login from Docker build workflow

- Eliminate previous checks for registry login credentials, including Basic-Auth and token request diagnostics.
- Streamline the workflow by focusing on essential steps for Gitea Container Registry login.
This commit is contained in:
smueller
2026-07-07 14:47:25 +02:00
parent e4150d0bc3
commit 9dd62999bd

View File

@@ -28,36 +28,6 @@ jobs:
- name: Docker Buildx einrichten
uses: docker/setup-buildx-action@v3
- name: Registry-Anmeldung prüfen (Diagnose)
env:
REG_USER: ${{ secrets.REGISTRY_USER || github.repository_owner }}
REG_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
run: |
IMAGE_LOWER=$(echo "${IMAGE_NAME}" | tr '[:upper:]' '[:lower:]')
echo "Registry: ${REGISTRY}"
echo "Username: '${REG_USER}' (Laenge: ${#REG_USER})"
echo "Token gesetzt: $([ -n "${REG_TOKEN}" ] && echo ja || echo NEIN) (Laenge: ${#REG_TOKEN})"
echo "Image (lower): ${IMAGE_LOWER}"
echo "--- API-Test: /api/v1/user (Basic-Auth gueltig?) ---"
curl -s -o /dev/null -w "HTTP %{http_code}\n" -u "${REG_USER}:${REG_TOKEN}" "https://${REGISTRY}/api/v1/user"
echo "--- /v2/ Challenge (WWW-Authenticate) ---"
HDR=$(curl -s -D - -o /dev/null "https://${REGISTRY}/v2/")
AUTH=$(printf '%s' "$HDR" | tr -d '\r' | grep -i '^www-authenticate:' || true)
echo "${AUTH:-(keine WWW-Authenticate Zeile)}"
REALM=$(printf '%s' "$AUTH" | sed -n 's/.*realm="\([^"]*\)".*/\1/p')
SERVICE=$(printf '%s' "$AUTH" | sed -n 's/.*service="\([^"]*\)".*/\1/p')
echo "realm='${REALM}' service='${SERVICE}'"
if [ -n "${REALM}" ]; then
echo "--- Token-Request am echten realm ---"
CODE=$(curl -s -o /tmp/tok.json -w "%{http_code}" -u "${REG_USER}:${REG_TOKEN}" \
"${REALM}?service=${SERVICE}&scope=repository:${IMAGE_LOWER}:pull,push")
echo "HTTP ${CODE}"
echo "Antwort (gekuerzt): $(head -c 300 /tmp/tok.json)"
fi
- name: An Gitea Container Registry anmelden
uses: docker/login-action@v3
with: