Fix Docker Hub description update: use --rawfile and capture error response
This commit is contained in:
@@ -100,16 +100,18 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
HTTP_CODE=$(jq -n \
|
HTTP_CODE=$(jq -n \
|
||||||
--arg full "$(cat DOCKER_HUB.md)" \
|
--rawfile full 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}' | \
|
||||||
curl -s -o /dev/null -w "%{http_code}" -X PATCH \
|
curl -s -o /tmp/hub-response.txt -w "%{http_code}" -X PATCH \
|
||||||
"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"
|
echo "Docker Hub API returned: $HTTP_CODE"
|
||||||
if [ "$HTTP_CODE" != "200" ]; then
|
if [ "$HTTP_CODE" != "200" ]; then
|
||||||
|
echo "Response body:"
|
||||||
|
cat /tmp/hub-response.txt
|
||||||
echo "::error::Docker Hub description update failed with HTTP $HTTP_CODE"
|
echo "::error::Docker Hub description update failed with HTTP $HTTP_CODE"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user