Delete duplicate release assets before upload to keep re-runs idempotent
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -74,6 +74,17 @@ jobs:
|
|||||||
| jq -r '.id')
|
| jq -r '.id')
|
||||||
|
|
||||||
for FILE in "${{ env.TARBALL }}" "${{ env.TARBALL }}.sha256"; do
|
for FILE in "${{ env.TARBALL }}" "${{ env.TARBALL }}.sha256"; do
|
||||||
|
# Remove any existing asset with the same name so re-runs stay clean
|
||||||
|
EXISTING=$(curl -s \
|
||||||
|
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||||
|
"${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/releases/${RELEASE_ID}/assets" \
|
||||||
|
| jq -r ".[] | select(.name == \"${FILE}\") | .id")
|
||||||
|
for AID in $EXISTING; do
|
||||||
|
curl -sX DELETE \
|
||||||
|
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||||
|
"${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}/releases/${RELEASE_ID}/assets/${AID}"
|
||||||
|
done
|
||||||
|
|
||||||
curl -sX POST \
|
curl -sX POST \
|
||||||
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||||
-H "Content-Type: application/octet-stream" \
|
-H "Content-Type: application/octet-stream" \
|
||||||
|
|||||||
Reference in New Issue
Block a user