Summary
The Post-IssueComment.ps1 script has unprotected Add-Content calls to $env:GITHUB_OUTPUT in the success paths. While PR #698 added proper error handling for the 403 error path, the existing success paths lack this protection.
Problem
Lines 102-111, 120-125, and 148-157 contain Add-Content calls without try-catch blocks:
# Example from success path (lines 102-111)
if ($env:GITHUB_OUTPUT) {
Add-Content -Path $env:GITHUB_OUTPUT -Value "success=true"
Add-Content -Path $env:GITHUB_OUTPUT -Value "skipped=false"
# ... more writes
}
If the GITHUB_OUTPUT file becomes unwritable (disk full, permissions, locked), these operations fail silently.
Solution
Apply the same error handling pattern used in the 403 path:
if ($env:GITHUB_OUTPUT -and (Test-Path $env:GITHUB_OUTPUT -PathType Leaf)) {
try {
$outputs = @("success=true", "skipped=false", ...)
$outputs | Add-Content -Path $env:GITHUB_OUTPUT -ErrorAction Stop
}
catch {
Write-Warning "Failed to write GitHub Actions outputs: $_"
}
}
Affected Files
.claude/skills/github/scripts/issue/Post-IssueComment.ps1
Related
🤖 Generated with Claude Code
Summary
The
Post-IssueComment.ps1script has unprotectedAdd-Contentcalls to$env:GITHUB_OUTPUTin the success paths. While PR #698 added proper error handling for the 403 error path, the existing success paths lack this protection.Problem
Lines 102-111, 120-125, and 148-157 contain
Add-Contentcalls without try-catch blocks:If the GITHUB_OUTPUT file becomes unwritable (disk full, permissions, locked), these operations fail silently.
Solution
Apply the same error handling pattern used in the 403 path:
Affected Files
.claude/skills/github/scripts/issue/Post-IssueComment.ps1Related
🤖 Generated with Claude Code