Test if forgejo resolves
Some checks failed
release / build (push) Failing after 3m7s

This commit is contained in:
Jared Miller 2025-12-20 11:59:30 -05:00
parent 85b1673d0d
commit e4115f101c
No known key found for this signature in database

View file

@ -50,7 +50,8 @@ jobs:
echo "Token length: ${#FORGEJO_TOKEN}" echo "Token length: ${#FORGEJO_TOKEN}"
TAG="${{ github.event.inputs.tag || github.ref_name }}" TAG="${{ github.event.inputs.tag || github.ref_name }}"
API_BASE="${{ github.server_url }}/api/v1" # use internal docker network URL instead of external
API_BASE="http://forgejo:3000/api/v1"
REPO="${{ github.repository }}" REPO="${{ github.repository }}"
# ensure tag exists (create at HEAD if not) # ensure tag exists (create at HEAD if not)
@ -69,15 +70,13 @@ jobs:
if [ "$RELEASE_ID" = "null" ] || [ -z "$RELEASE_ID" ]; then if [ "$RELEASE_ID" = "null" ] || [ -z "$RELEASE_ID" ]; then
echo "Creating release for ${TAG}..." echo "Creating release for ${TAG}..."
echo '{"tag_name": "'"${TAG}"'", "name": "'"${TAG}"'"}' > /tmp/payload.json RESPONSE=$(curl -s -X POST \
cat /tmp/payload.json
RESPONSE=$(curl -sv --http1.1 -X POST \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-H "Authorization: token ${FORGEJO_TOKEN}" \ -H "Authorization: token ${FORGEJO_TOKEN}" \
--data-binary @/tmp/payload.json \ -d '{"tag_name": "'"${TAG}"'", "name": "'"${TAG}"'"}' \
"${API_BASE}/repos/${REPO}/releases" 2>&1) "${API_BASE}/repos/${REPO}/releases")
echo "Full response: ${RESPONSE}" echo "Create response: ${RESPONSE}"
RELEASE_ID=$(echo "$RESPONSE" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2) RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id')
fi fi
echo "Release ID: ${RELEASE_ID}" echo "Release ID: ${RELEASE_ID}"