Skip to content

[BUG]: Token not correctly being retrieved from the Github CLI when using Enterprise EU Data Residency #3314

@yoep

Description

@yoep

Expected Behavior

The provider should retrieve the Github CLI token of XXX.ghe.com when the base_url has been configured for Github Enterprise EU Data Residency.

Actual Behavior

The provider is unable to retrieve the Github CLI token for the hostname, as it's using the incorrect base_url.
This results in "no oauth token found for api.XXX.ghe.com".

Terraform Version

Terraform v1.14.8
on darwin_amd64

  • provider registry.terraform.io/integrations/github v6.11.1

Affected Resource(s)

  • all resources

Terraform Configuration Files

terraform {
  required_providers {
    github = {
      source  = "integrations/github"
      version = "6.11.1"
    }
  }
}

provider "github" {
  base_url = "https://XXX.ghe.com"
  owner    = "FooBar"
}

Steps to Reproduce

  • Authenticate with the Github CLI
gh auth login -h XXX.ghe.com
  • Make sure the provider is configured for Enterprise EU Data Residency
  • Run Terraform plan

Debug Output

2026-04-01T15:45:51.802+0200 [INFO]  provider.terraform-provider-github_v6.11.1: 2026/04/01 15:45:51 [INFO] Selecting owner  from GITHUB_OWNER environment variable: timestamp="2026-04-01T15:45:51.802+0200"
2026-04-01T15:45:51.802+0200 [INFO]  provider.terraform-provider-github_v6.11.1: 2026/04/01 15:45:51 [INFO] No token found, using GitHub CLI to get token from hostname api.XXX.ghe.com: timestamp="2026-04-01T15:45:51.802+0200"
2026-04-01T15:45:51.968+0200 [INFO]  provider.terraform-provider-github_v6.11.1: 2026/04/01 15:45:51 [DEBUG] Error getting token from GitHub CLI: exit status 1: timestamp="2026-04-01T15:45:51.968+0200"

Panic Output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: TriageThis is being looked at and prioritizedType: BugSomething isn't working as documented

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions