Repository navigation
Regression: gh pr create fails on self-hosted runner in v2.76.0 – “Resource not accessible by integration (organization.teams)” #11360
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workingcoreThis issue is not accepting PRs from outside contributorsThis issue is not accepting PRs from outside contributorsgh-prrelating to the gh pr commandrelating to the gh pr commandpriority-2Affects more than a few users but doesn't prevent core functionsAffects more than a few users but doesn't prevent core functions
Description
Activity
👋 Hey @Pittan, thank you for opening this issue ✨
I believe this was introduced in #11279, and I'm investigating and discussing with the team.
Expand for investigation notes
Previously we checked if any user-provided reviewer contained a
/:var teams []string for _, r := range input.Reviewers { if i := strings.IndexRune(r, '/'); i > -1 { teams = append(teams, r[i+1:]) } else if !hasUser(r) { users = append(users, r) } }
This informed the query builder later to decide whether it would request teams:
if len(teams) > 0 { fmt.Fprintf(query, "organization(login:%q){\n", repo.RepoOwner()) for i, t := range teams { fmt.Fprintf(query, "t%03d: team(slug:%q){id,slug}\n", i, t) } fmt.Fprint(query, "}\n") }
So the conclusion being previously we only requested teams when we believed the user input to contain them.
Now, we always fetch the teams if we have any reviewers:
if input.Reviewers { g.Go(func() error { teams, err := OrganizationTeams(client, repo) // TODO: better detection of non-org repos if err != nil && !strings.Contains(err.Error(), errorResolvingOrganization) { err = fmt.Errorf("error fetching organization teams: %w", err) return err } result.Teams = teams return nil }) }
Reacted by Amon Keishima- addedpriority-2Affects more than a few users but doesn't prevent core functionsAffects more than a few users but doesn't prevent core functionsgh-prrelating to the gh pr commandrelating to the gh pr commandcoreThis issue is not accepting PRs from outside contributorsThis issue is not accepting PRs from outside contributorsand removedneeds-triageneeds to be reviewedneeds to be reviewed
on Jul 22, 2025 @BagToad @andyfeller
Thank you for your quick action 😄Reacted by Kynan Ware- added a commit that references this issue
on Jul 27, 2025 @BagToad @andyfeller when will this CLI update be pushed out to GitHub hosted runners? As of Jul 29, 2025 I'm still seeing version
2.76.0of the CLI in workflows.
oh I see there's an open issue for this: actions/runner-images#12648
Reacted by Ronnie Dutta, Mihnea Duican and Kynan Ware
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcoreThis issue is not accepting PRs from outside contributorsThis issue is not accepting PRs from outside contributorsgh-prrelating to the gh pr commandrelating to the gh pr commandpriority-2Affects more than a few users but doesn't prevent core functionsAffects more than a few users but doesn't prevent core functions
Note: English isn’t my strongest skill, so I used AI to help translate this issue. If anything looks odd, please feel free to let me know!
Describe the bug
Running
gh pr createinside a GitHub Actions workflow on a self-hosted runner (GitHub Enterprise Server) fails inghv2.76.0, while the same workflow succeeds in v2.75.1.Error message:
Affected version
gh version 2.76.0
(v2.75.1 works as expected)
GHE 3.14.7
Steps to reproduce the behavior
GITHUB_TOKEN):Expected vs actual behavior
Expected – The pull request is created successfully without errors.
Actual – The command aborts with
error fetching organization teams: GraphQL: Resource not accessible by integration (organization.teams).
Logs