fix(release): URL-encode release asset names #6

Merged
adrianbonpin merged 1 commits from fix/release-asset-name-encoding into prod 2026-08-20 04:49:35 +00:00
+5 -1
View File
@@ -76,8 +76,12 @@ jobs:
# Attach zips and the signed xpi (if present) as release assets # Attach zips and the signed xpi (if present) as release assets
for f in dist/*.zip dist/*.xpi; do for f in dist/*.zip dist/*.xpi; do
[ -f "$f" ] || continue [ -f "$f" ] || continue
NAME="$(basename "$f")"
# URL-encode the asset name so '+' (in 'ismis-helper-1.4.0-an+fx.xpi')
# survives the query string instead of being decoded to a space.
ENC=$(python3 -c "import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1], safe=''))" "$NAME")
curl -sS -X POST \ curl -sS -X POST \
-H "Authorization: token ${GITHUB_TOKEN}" \ -H "Authorization: token ${GITHUB_TOKEN}" \
-F "attachment=@${f}" \ -F "attachment=@${f}" \
"${API}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=$(basename "${f}")" "${API}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=${ENC}"
done done