From de659fbc54c1e5480c8b0241a7742fa84315b8a6 Mon Sep 17 00:00:00 2001 From: Joakim Persson Date: Sun, 12 Apr 2026 19:10:55 +0200 Subject: [PATCH] Switch to new Docker Hub /v2/auth/token API for description updates The old /v2/users/login endpoint is deprecated and returns tokens with insufficient permissions. Use /v2/auth/token with Bearer auth instead. --- .gitea/workflows/docker-publish.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/docker-publish.yml b/.gitea/workflows/docker-publish.yml index 07af2da..0d8c561 100644 --- a/.gitea/workflows/docker-publish.yml +++ b/.gitea/workflows/docker-publish.yml @@ -105,10 +105,10 @@ jobs: - name: Update Docker Hub description run: | - TOKEN=$(curl -s -X POST https://hub.docker.com/v2/users/login/ \ + TOKEN=$(curl -s -X POST https://hub.docker.com/v2/auth/token \ -H "Content-Type: application/json" \ - -d '{"username":"${{ vars.DOCKERHUB_USERNAME }}","password":"${{ secrets.DOCKERHUB_TOKEN }}"}' \ - | jq -r .token) + -d '{"identifier":"${{ vars.DOCKERHUB_USERNAME }}","secret":"${{ secrets.DOCKERHUB_TOKEN }}"}' \ + | jq -r .access_token) if [ "$TOKEN" = "null" ] || [ -z "$TOKEN" ]; then echo "::error::Failed to authenticate with Docker Hub API" exit 1 @@ -119,7 +119,7 @@ jobs: '{"full_description": $full, "description": $short}' | \ curl -s -o /tmp/hub-response.txt -w "%{http_code}" -X PATCH \ "https://hub.docker.com/v2/repositories/${{ vars.DOCKERHUB_USERNAME }}/opencode-devbox/" \ - -H "Authorization: JWT $TOKEN" \ + -H "Authorization: Bearer $TOKEN" \ -H "Content-Type: application/json" \ -d @-) echo "Docker Hub API returned: $HTTP_CODE"