Add diagnostic step for registry login in Docker build workflow
- Introduce a new step to check registry login credentials, providing feedback on username and token status. - Implement curl commands to test Basic-Auth and Bearer-Flow for improved debugging during the Docker build process.
This commit is contained in:
@@ -28,6 +28,20 @@ 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: |
|
||||
echo "Registry: ${REGISTRY}"
|
||||
echo "Username: '${REG_USER}' (Laenge: ${#REG_USER})"
|
||||
echo "Token gesetzt: $([ -n "${REG_TOKEN}" ] && echo ja || echo NEIN) (Laenge: ${#REG_TOKEN})"
|
||||
echo "--- Test 1: /v2/ mit Basic-Auth ---"
|
||||
curl -s -o /dev/null -w "HTTP %{http_code}\n" -u "${REG_USER}:${REG_TOKEN}" "https://${REGISTRY}/v2/"
|
||||
echo "--- Test 2: Token-Endpoint (Bearer-Flow) ---"
|
||||
curl -s -o /dev/null -w "HTTP %{http_code}\n" -u "${REG_USER}:${REG_TOKEN}" \
|
||||
"https://${REGISTRY}/v2/token?scope=repository:${IMAGE_NAME}:pull,push&service=container_registry" || true
|
||||
|
||||
- name: An Gitea Container Registry anmelden
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
|
||||
Reference in New Issue
Block a user