mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-19 22:09:37 +00:00
fix: use REST API for issue/PR detection
gh pr view --json number falsely matches issues. Use gh api
repos/{repo}/issues/{n} with has("pull_request") for reliable detection.
This commit is contained in:
@@ -171,12 +171,11 @@ function resolveTarget(input: string): {
|
||||
|
||||
function detectType(number: string, repo: string): TargetType {
|
||||
try {
|
||||
execSync(`gh pr view ${number} --repo ${repo} --json number`, {
|
||||
encoding: 'utf-8',
|
||||
timeout: 15000,
|
||||
stdio: ['pipe', 'pipe', 'pipe']
|
||||
})
|
||||
return 'pr'
|
||||
const result = execSync(
|
||||
`gh api repos/${repo}/issues/${number} --jq 'has("pull_request")'`,
|
||||
{ encoding: 'utf-8', timeout: 15000, stdio: ['pipe', 'pipe', 'pipe'] }
|
||||
)
|
||||
return result.trim() === 'true' ? 'pr' : 'issue'
|
||||
} catch {
|
||||
return 'issue'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user