diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 083300a..a6891fa 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -94,7 +94,9 @@ jobs: echo "No RELEASE_NOTES.md found" fi - BODY=$(python3 -c " + # Build release payload (avoids shell escaping & CLI length limits) + export TAG VERSION IS_PRE + python3 <<'PY' import json, os release_notes = os.environ.get('RELEASE_NOTES', '') @@ -106,22 +108,16 @@ jobs: if changelog: sections.append('## Changelog\n\n' + changelog) - print(json.dumps('\n\n'.join(sections))) - ") - - # Send body via file to avoid CLI length limits / shell escaping - python3 -c " - import json, os - body = os.environ['BODY'] payload = { 'tag_name': os.environ['TAG'], - 'name': f\"Notify Bridge {os.environ['VERSION']}\", - 'body': json.loads(body), + 'name': f"Notify Bridge {os.environ['VERSION']}", + 'body': '\n\n'.join(sections), 'draft': False, 'prerelease': os.environ['IS_PRE'] == 'true', } - open('/tmp/release-payload.json','w').write(json.dumps(payload)) - " BODY="$BODY" TAG="$TAG" VERSION="$VERSION" IS_PRE="$IS_PRE" + with open('/tmp/release-payload.json', 'w') as f: + json.dump(payload, f) + PY HTTP=$(curl -s -o /tmp/release-resp.json -w "%{http_code}" \ -X POST "$BASE_URL/releases" \