Add error handling to Docker Hub description update step
Publish Docker Image / build-base (push) Successful in 31m21s
Publish Docker Image / build-omos (push) Successful in 32m22s
Publish Docker Image / update-description (push) Failing after 15s

This commit is contained in:
2026-04-11 22:16:09 +02:00
parent 078c095116
commit 56f98da914
+11 -2
View File
@@ -95,7 +95,11 @@ jobs:
-H "Content-Type: application/json" \
-d '{"username":"${{ vars.DOCKERHUB_USERNAME }}","password":"${{ secrets.DOCKERHUB_TOKEN }}"}' \
| jq -r .token)
jq -n \
if [ "$TOKEN" = "null" ] || [ -z "$TOKEN" ]; then
echo "::error::Failed to authenticate with Docker Hub API"
exit 1
fi
HTTP_CODE=$(jq -n \
--arg full "$(cat DOCKER_HUB.md)" \
--arg short "Portable AI dev environment for opencode. Debian-based with git, Node.js, AWS CLI, and SSH support. Available in base and omos (multi-agent) variants." \
'{"full_description": $full, "description": $short}' | \
@@ -103,4 +107,9 @@ jobs:
"https://hub.docker.com/v2/repositories/${{ vars.DOCKERHUB_USERNAME }}/opencode-devbox/" \
-H "Authorization: JWT $TOKEN" \
-H "Content-Type: application/json" \
-d @-
-d @-)
echo "Docker Hub API returned: $HTTP_CODE"
if [ "$HTTP_CODE" != "200" ]; then
echo "::error::Docker Hub description update failed with HTTP $HTTP_CODE"
exit 1
fi