Skip to content

Commit

Permalink
fix: 🐛 gPT-4: Fix variable reference issue in PowerShell error handling
Browse files Browse the repository at this point in the history
- Correct the reference to $LASTEXITCODE variable in Write-Error statement
- Use $(...) syntax to ensure proper parsing of variable names with underscores
- Improve accuracy and readability of error messages
  • Loading branch information
xmaihh committed Jul 26, 2024
1 parent 812a843 commit 3fef21c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/publish-to-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
Write-Host "Attempting to delete release: $release"
$output = gh release delete $release --cleanup-tag -y 2>&1 | Out-String
if ($LASTEXITCODE -ne 0) {
Write-Error "Command failed with exit code $LASTEXITCODE: $output"
Write-Error "Command failed with exit code $($LASTEXITCODE): $output"
continue
}
} catch {
Expand Down

0 comments on commit 3fef21c

Please sign in to comment.