Fix Forgejo CI: URL-encode filenames with spaces for upload
Some checks failed
Release / build-and-release (push) Has been cancelled
Some checks failed
Release / build-and-release (push) Has been cancelled
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
66b25dd707
commit
530c556e95
1 changed files with 2 additions and 1 deletions
|
|
@ -142,10 +142,11 @@ jobs:
|
|||
# Upload all assets
|
||||
for file in release-assets/*; do
|
||||
FILENAME=$(basename "$file")
|
||||
ENCODED_FILENAME=$(printf '%s' "$FILENAME" | jq -sRr @uri)
|
||||
FILESIZE=$(stat -c%s "$file")
|
||||
echo "Uploading: $FILENAME (${FILESIZE} bytes)"
|
||||
HTTP_CODE=$(curl -w "%{http_code}" --max-time 300 -X POST \
|
||||
"${API_URL}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=${FILENAME}" \
|
||||
"${API_URL}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=${ENCODED_FILENAME}" \
|
||||
-H "Authorization: token ${FORGEJO_TOKEN}" \
|
||||
-H "Content-Type: application/octet-stream" \
|
||||
--data-binary "@${file}" \
|
||||
|
|
|
|||
Loading…
Reference in a new issue