-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Improve issue-triage skill: Add gh CLI checks and fix workflow #33750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -99,6 +99,36 @@ param( | |||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| $ErrorActionPreference = "Stop" | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| # Check for GitHub CLI prerequisite | ||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||
| $null = Get-Command gh -ErrorAction Stop | ||||||||||||||||||||||||||||||||
| } catch { | ||||||||||||||||||||||||||||||||
| Write-Host "" | ||||||||||||||||||||||||||||||||
| Write-Host "❌ GitHub CLI (gh) is not installed" -ForegroundColor Red | ||||||||||||||||||||||||||||||||
| Write-Host "" | ||||||||||||||||||||||||||||||||
| Write-Host "The issue-triage skill requires GitHub CLI for querying issues." -ForegroundColor Yellow | ||||||||||||||||||||||||||||||||
| Write-Host "" | ||||||||||||||||||||||||||||||||
| Write-Host "Installation:" -ForegroundColor Cyan | ||||||||||||||||||||||||||||||||
| Write-Host " Windows: winget install --id GitHub.cli" -ForegroundColor White | ||||||||||||||||||||||||||||||||
| Write-Host " macOS: brew install gh" -ForegroundColor White | ||||||||||||||||||||||||||||||||
| Write-Host " Linux: See https://cli.github.com/manual/installation" -ForegroundColor White | ||||||||||||||||||||||||||||||||
| Write-Host "" | ||||||||||||||||||||||||||||||||
| Write-Host "After installation, authenticate with: gh auth login" -ForegroundColor Cyan | ||||||||||||||||||||||||||||||||
| Write-Host "" | ||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
| # Verify GitHub CLI authentication status | |
| & gh auth status 1>$null 2>$null | |
| if ($LASTEXITCODE -ne 0) { | |
| Write-Host "" | |
| Write-Host "❌ GitHub CLI (gh) is not authenticated" -ForegroundColor Red | |
| Write-Host "" | |
| Write-Host "The issue-triage skill requires an authenticated GitHub CLI session to query issues." -ForegroundColor Yellow | |
| Write-Host "" | |
| Write-Host "Please authenticate by running:" -ForegroundColor Cyan | |
| Write-Host " gh auth login" -ForegroundColor White | |
| Write-Host "" | |
| exit 1 | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prerequisite check validates that
ghCLI is installed, but it only reports success without verifying authentication status. After the check passes, the script still usesgh apiat line 153 to fetch labels, which will fail if the user hasn't authenticated withgh auth login. Consider adding an authentication check (e.g.,gh auth status) or catching the authentication error at line 153 with a more specific error message directing users to rungh auth login.