fix(issue create): use IssueRepoInfo to avoid requiring Contents:Read permission

Switch issue create from GitHubRepo to IssueRepoInfo so that
gh issue create works with fine-grained PATs that only have
Issues:Write and Metadata:Read permissions.

Fixes cli/cli#12798

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Babak K. Shandiz 2026-03-09 11:33:12 +00:00
parent 11e5be7842
commit 1d95b633e3
No known key found for this signature in database
GPG key ID: 9472CAEFF56C742E

View file

@ -239,7 +239,7 @@ func createRun(opts *CreateOptions) (err error) {
fmt.Fprintf(opts.IO.ErrOut, "\nCreating issue in %s\n\n", ghrepo.FullName(baseRepo))
}
repo, err := api.GitHubRepo(apiClient, baseRepo)
repo, err := api.IssueRepoInfo(apiClient, baseRepo)
if err != nil {
return
}