Skip to content

Commit c852c05

Browse files
Eli CortezCopilot
andcommitted
fix: rename temp file before upload so asset gets correct filename
The gh release upload command uses the actual filename, not the #label syntax, for the asset name. Renaming the temp file before uploading ensures assets get descriptive names instead of 'tmp.XXXXXXXXXX'. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 2f99b58 commit c852c05

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/migrate-blob-to-release.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,16 +131,21 @@ jobs:
131131
FILE_SIZE=$(stat -c%s "$TMPFILE")
132132
echo "Downloaded: ${FILE_SIZE} bytes"
133133
134+
# Rename temp file so the asset gets the correct filename
135+
UPLOAD_DIR=$(mktemp -d)
136+
mv "$TMPFILE" "$UPLOAD_DIR/$ASSET_NAME"
137+
TMPFILE="$UPLOAD_DIR/$ASSET_NAME"
138+
134139
# Upload to the release
135-
if gh release upload "$TAG" "$TMPFILE#$ASSET_NAME" --clobber; then
140+
if gh release upload "$TAG" "$TMPFILE" --clobber; then
136141
echo "PASS: $ASSET_NAME"
137142
PASS=$((PASS + 1))
138143
else
139144
echo "::warning::FAIL upload $ASSET_NAME"
140145
FAIL=$((FAIL + 1))
141146
fi
142147
143-
rm -f "$TMPFILE"
148+
rm -rf "$UPLOAD_DIR"
144149
145150
done < "$URL_FILE"
146151

0 commit comments

Comments
 (0)