Skip existing release assets instead of replacing them
This commit is contained in:
@@ -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)"
|
||||
|
||||
Reference in New Issue
Block a user