Debug workflow
Some checks failed
release / build (push) Failing after 2m33s

This commit is contained in:
Jared Miller 2025-12-19 17:13:58 -05:00
parent bd3dbca0c7
commit 140d51f181
No known key found for this signature in database

View file

@ -46,10 +46,20 @@ jobs:
env: env:
FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }} FORGEJO_TOKEN: ${{ secrets.FORGEJO_TOKEN }}
run: | run: |
echo "Token present: ${FORGEJO_TOKEN:+yes}"
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" API_BASE="${{ github.server_url }}/api/v1"
REPO="${{ github.repository }}" REPO="${{ github.repository }}"
# ensure tag exists (create at HEAD if not)
curl -s -X POST \
-H "Authorization: token ${FORGEJO_TOKEN}" \
-H "Content-Type: application/json" \
-d "{\"tag_name\": \"${TAG}\"}" \
"${API_BASE}/repos/${REPO}/tags" || true
# get or create release # get or create release
echo "Looking for release: ${API_BASE}/repos/${REPO}/releases/tags/${TAG}" echo "Looking for release: ${API_BASE}/repos/${REPO}/releases/tags/${TAG}"
RESPONSE=$(curl -s -H "Authorization: token ${FORGEJO_TOKEN}" \ RESPONSE=$(curl -s -H "Authorization: token ${FORGEJO_TOKEN}" \
@ -59,13 +69,15 @@ 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}..."
RESPONSE=$(curl -s -X POST \ JSON_PAYLOAD=$(printf '{"tag_name": "%s", "name": "%s"}' "$TAG" "$TAG")
echo "Payload: ${JSON_PAYLOAD}"
RESPONSE=$(curl -sv -X POST \
-H "Authorization: token ${FORGEJO_TOKEN}" \ -H "Authorization: token ${FORGEJO_TOKEN}" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d "{\"tag_name\": \"${TAG}\", \"name\": \"${TAG}\"}" \ -d "$JSON_PAYLOAD" \
"${API_BASE}/repos/${REPO}/releases") "${API_BASE}/repos/${REPO}/releases" 2>&1)
echo "Create response: ${RESPONSE}" echo "Full response: ${RESPONSE}"
RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id') RELEASE_ID=$(echo "$RESPONSE" | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
fi fi
echo "Release ID: ${RELEASE_ID}" echo "Release ID: ${RELEASE_ID}"