Skip to content

Commit fb570b5

Browse files
committed
Fix bug when uploading release assets
1 parent 55b98bd commit fb570b5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tools/ReleaseTools.psm1

+4-1
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,10 @@ function New-DraftRelease {
424424
$Release = New-GitHubRelease @ReleaseParams
425425
if ($Release) {
426426
Write-Host "Draft release URL: $($Release.html_url)"
427+
# NOTE: We must loop around `New-GitHubReleaseAsset` so we can pipe
428+
# `$Release` or it can fail to find the newly created release by its ID
429+
# (probably a race condition).
427430
Write-Host "Uploading assets..."
428-
$Assets | New-GitHubReleaseAsset -Release $Release.Id
431+
$Assets | ForEach-Object { $Release | New-GitHubReleaseAsset -Path $_ }
429432
}
430433
}

0 commit comments

Comments
 (0)