From 2a5b58ad3e9da67f749adb5acd53b69a802cef55 Mon Sep 17 00:00:00 2001 From: Arne Weiss Date: Mon, 1 Jun 2026 08:10:17 +0200 Subject: [PATCH] Fix release pipeline: add contents:write permission, log API response --- .gitea/workflows/release.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 79c24af..2f70d68 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -8,6 +8,8 @@ on: jobs: release: runs-on: ubuntu-latest + permissions: + contents: write container: image: php:8.2-cli-alpine @@ -38,11 +40,17 @@ jobs: TOKEN: ${{ secrets.GITHUB_TOKEN }} TAG: ${{ github.ref_name }} run: | - RELEASE_ID=$(curl -sf -X POST \ + RESPONSE=$(curl -s -X POST \ -H "Authorization: token $TOKEN" \ -H "Content-Type: application/json" \ "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/releases" \ - -d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\"}" | jq -r '.id') + -d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\"}") + echo "API response: $RESPONSE" + + RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id') + if [ -z "$RELEASE_ID" ] || [ "$RELEASE_ID" = "null" ]; then + echo "Failed to create release" && exit 1 + fi curl -sf -X POST \ -H "Authorization: token $TOKEN" \