Add error handling to Docker Hub description update step
This commit is contained in:
@@ -95,7 +95,11 @@ jobs:
|
|||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d '{"username":"${{ vars.DOCKERHUB_USERNAME }}","password":"${{ secrets.DOCKERHUB_TOKEN }}"}' \
|
-d '{"username":"${{ vars.DOCKERHUB_USERNAME }}","password":"${{ secrets.DOCKERHUB_TOKEN }}"}' \
|
||||||
| jq -r .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 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." \
|
--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}' | \
|
'{"full_description": $full, "description": $short}' | \
|
||||||
@@ -103,4 +107,9 @@ jobs:
|
|||||||
"https://hub.docker.com/v2/repositories/${{ vars.DOCKERHUB_USERNAME }}/opencode-devbox/" \
|
"https://hub.docker.com/v2/repositories/${{ vars.DOCKERHUB_USERNAME }}/opencode-devbox/" \
|
||||||
-H "Authorization: JWT $TOKEN" \
|
-H "Authorization: JWT $TOKEN" \
|
||||||
-H "Content-Type: application/json" \
|
-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
|
||||||
|
|||||||
Reference in New Issue
Block a user