diff --git a/nupkg/push-nightly-packages-myget.ps1 b/nupkg/push-nightly-packages-myget.ps1 index 5496bcfd74..3127d21f0c 100644 --- a/nupkg/push-nightly-packages-myget.ps1 +++ b/nupkg/push-nightly-packages-myget.ps1 @@ -1,7 +1,6 @@ param( [string]$source, - [string]$apikey, - [string]$discordWebhookUrl + [string]$apikey ) if (!$source) @@ -14,11 +13,6 @@ if (!$apikey) $apikey = "dummy" } -if (!$discordWebhookUrl) -{ - $discordWebhookUrl = $env:DISCORD_WEBHOOK_URL -} - $maxRetryCount = 3 $retryDelaysInSeconds = @(30, 60, 120) $failedPackages = @() @@ -67,26 +61,5 @@ if ($failedPackages.Count -gt 0) { $errorCount = $failedPackages.Count Write-Host ("******* $errorCount error(s) occured *******") -ForegroundColor red - - if (-not [string]::IsNullOrWhiteSpace($discordWebhookUrl)) - { - try - { - $messageLines = @( - "Nightly NuGet push completed with failures (ABP).", - "Failed package count: $errorCount", - "Failed packages:" - ) + ($failedPackages | ForEach-Object { "- $_" }) - - $payload = @{ content = ($messageLines -join "`n") } | ConvertTo-Json -Compress - Invoke-RestMethod -Uri $discordWebhookUrl -Method Post -ContentType "application/json" -Body $payload | Out-Null - Write-Host "Discord notification sent for failed packages." - } - catch - { - Write-Warning "Failed to send Discord webhook notification: $($_.Exception.Message)" - } - } - exit 1 } \ No newline at end of file diff --git a/nupkg/push_packages.ps1 b/nupkg/push_packages.ps1 index db70b2f8e3..005610a346 100644 --- a/nupkg/push_packages.ps1 +++ b/nupkg/push_packages.ps1 @@ -1,7 +1,6 @@ . ".\common.ps1" $apiKey = $args[0] -$discordWebhookUrl = if ($args.Length -gt 1) { $args[1] } else { $env:DISCORD_WEBHOOK_URL } # Get the version [xml]$commonPropsXml = Get-Content (Join-Path $rootFolder "common.props") @@ -77,24 +76,5 @@ foreach($project in $projects) { if ($errorCount > 0) { Write-Host ("******* $errorCount error(s) occured *******") -ForegroundColor red - - if (-not [string]::IsNullOrWhiteSpace($discordWebhookUrl)) - { - try - { - $messageLines = @( - "NuGet push completed with failures (ABP).", - "Failed package count: $errorCount", - "Failed packages:" - ) + ($failedPackages | ForEach-Object { "- $_" }) - - $payload = @{ content = ($messageLines -join "`n") } | ConvertTo-Json -Compress - Invoke-RestMethod -Uri $discordWebhookUrl -Method Post -ContentType "application/json" -Body $payload | Out-Null - Write-Info "Discord notification sent for failed packages." - } - catch - { - Write-Warning "Failed to send Discord webhook notification: $($_.Exception.Message)" - } - } + exit 1 }