Skip to content

add-wizard and add --create-pull-request fail to create PR on GitHub Enterprise Server repositories #20875

@lpcox

Description

@lpcox

Environment

  • gh aw v0.58.1
  • Repository hosted on GitHub Enterprise Server (GHES)
  • gh CLI authenticated to both github.com and the GHES instance

Problem

When running gh aw add-wizard (or gh aw add --create-pull-request) in a repo whose origin remote points to a GHES instance (e.g. https://ghes-host.example.com/org/repo.git), the wizard completes all steps successfully — downloads the workflow template from github.com, configures it, commits, and pushes the branch — but fails at PR creation with:

GraphQL: Could not resolve to a Repository with the name 'org/repo'. (repository)

The PR creation call is being sent to the github.com GraphQL API instead of the GHES instance's API, even though the git remote clearly points to GHES.

What was tried

  1. Default invocation — wizard detected the correct repo name but hit github.com for the PR.
  2. GH_HOST=<ghe-host> gh aw add-wizard ... — This correctly targeted GHES for the PR, but also redirected the workflow template fetch to GHES, where githubnext/agentics doesn't exist, resulting in a 404.

Workaround

Ran gh aw add without --create-pull-request (which successfully fetched the template from github.com and pushed the branch to GHES), then manually created the PR with gh pr create, which correctly resolved the GHES host from the git remote.

Expected behavior

The wizard should fetch workflow templates from github.com but resolve the target repository host from the git remote (or gh auth config) when creating the PR — the same way gh pr create does.

Metadata

Metadata

Labels

bugSomething isn't workingcli

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions