From 0895501234afeacbfc7d972382535c6570cfb58c Mon Sep 17 00:00:00 2001 From: antior Date: Fri, 31 Jul 2026 17:14:40 +0800 Subject: [PATCH] Skip existing release assets instead of replacing them --- .gitea/workflows/publish-dlp-io.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/publish-dlp-io.yaml b/.gitea/workflows/publish-dlp-io.yaml index abfa559..6f2e360 100644 --- a/.gitea/workflows/publish-dlp-io.yaml +++ b/.gitea/workflows/publish-dlp-io.yaml @@ -326,9 +326,9 @@ jobs: foreach ($artifact in $artifacts) { $existing = @($release.assets | Where-Object name -eq $artifact.Name) - foreach ($asset in $existing) { - Invoke-RestMethod -Method Delete -Headers $headers -Uri "$api/releases/assets/$($asset.id)" | Out-Null - Write-Host "replaced asset: $($artifact.Name)" + if ($existing.Count -gt 0) { + Write-Host "asset already exists, skipping: $($artifact.Name)" + continue } Invoke-RestMethod -Method Post -Headers $headers -Uri "$api/releases/$($release.id)/assets?name=$($artifact.Name)" -Form @{ attachment = Get-Item $artifact.FullName } | Out-Null Write-Host "uploaded asset: $($artifact.Name)"