You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(github): org repo listing fails with fine-grained PATs lacking Issues:Read (#415)
Root cause: `issues { totalCount }` is typed `Int!` in GitHub's GraphQL schema.
When a FGPAT lacks Issues:Read on private repos, GitHub cannot resolve that
non-null field and nulls out the entire repo node — silently dropping those
repos from the batch and surfacing the error as a full batch failure.
Fix: move issues fetching into a dedicated `issueNodes: repositories(...)`
alias within the same GraphQL query. The main `repositories` selection no
longer includes `issues`, so all repos are always returned regardless of
Issues:Read permission. The shurcooL/graphql library unmarshals response data
before returning errors, so when issueNodes gets FORBIDDEN the main repo list
is already intact.
- isIssuesPermissionError() detects this partial-success case so the retry
function returns nil and pagination continues normally
- repoWithIssueCount carries the count matched by databaseId; repos where
Issues:Read is missing get count 0 without any error or dropped data
- isFatalError() + early break added so true auth failures (bad credentials,
401/403) stop pagination immediately instead of exhausting retries
Minimum required FGPAT permissions for analyze_org: resource owner set to the
target org + Repository > Contents: Read. Members:Read and Issues:Read are not
required.
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
0 commit comments