Compare commits

...

2 Commits

Author SHA1 Message Date
23cc1e0e08 ci: use jq to build JSON payload safely
All checks were successful
CI/CD / Test (push) Successful in 1m15s
CI/CD / Lint (push) Successful in 1m21s
CI/CD / Build & Release (push) Successful in 1m53s
CI/CD / Mirror to GitHub (push) Has been skipped
2026-01-07 12:52:59 +01:00
7770abab6f ci: fix JSON escaping in release creation
Some checks failed
CI/CD / Test (push) Successful in 1m15s
CI/CD / Lint (push) Successful in 1m22s
CI/CD / Build & Release (push) Failing after 1m49s
CI/CD / Mirror to GitHub (push) Has been skipped
2026-01-07 12:45:03 +01:00

View File

@@ -113,11 +113,20 @@ jobs:
echo "Creating Gitea release for ${TAG}..." echo "Creating Gitea release for ${TAG}..."
# Use jq to build valid JSON with proper escaping
BODY="Download binaries for your platform: Linux (amd64, arm64), macOS (Intel, Apple Silicon), FreeBSD (amd64)"
JSON_PAYLOAD=$(jq -n \
--arg tag "$TAG" \
--arg name "$TAG" \
--arg body "$BODY" \
'{tag_name: $tag, name: $name, body: $body, draft: false, prerelease: false}')
# Create release via API # Create release via API
RESPONSE=$(curl -s -X POST \ RESPONSE=$(curl -s -X POST \
-H "Authorization: token ${GITEA_TOKEN}" \ -H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d "{\"tag_name\":\"${TAG}\",\"name\":\"${TAG}\",\"body\":\"## Download\\n\\nSelect the binary for your platform.\\n\\n### Platforms\\n- Linux (amd64, arm64)\\n- macOS (Intel, Apple Silicon)\\n- FreeBSD (amd64)\",\"draft\":false,\"prerelease\":false}" \ -d "$JSON_PAYLOAD" \
"https://git.uuxo.net/api/v1/repos/${GITHUB_REPOSITORY}/releases") "https://git.uuxo.net/api/v1/repos/${GITHUB_REPOSITORY}/releases")
RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id') RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id')