Skip to content

gh release create does not recognise GitHub Enterprise Cloud (ghe.com) remotes when using GH_TOKEN #14389

Description

@JackMyers001

Describe the bug

After migrating from GitHub.com to GitHub Enterprise Cloud with data residency (<tenant>.ghe.com), an existing GitHub Actions release workflow fails because gh does not recognise the repository's remote as a known GitHub host.

The workflow supplies GH_TOKEN using secrets.GITHUB_TOKEN:

- name: Create GitHub Release
  env:
    GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
    TAG: ${{ github.ref_name }}
  run: gh release create "${TAG}" --generate-notes

The checkout's remote points to https://<tenant>.ghe.com/<owner>/<repo>, but gh release create asks me to run gh auth login.

Explicitly setting the repository fixes the problem:

env:
  GH_REPO: ${{ github.server_url }}/${{ github.repository }}

Affected version

gh version 2.98.0 (2026-08-20)

Steps to reproduce the behavior

  1. Use a repository on GitHub Enterprise Cloud with data residency (<tenant>.ghe.com).
  2. Run the following workflow by pushing a version tag.
  3. Observe that the gh release create step fails.
name: Release

on:
  push:
    tags:
      - "[0-9]+.[0-9]+.[0-9]+"

permissions: {}

jobs:
  gh-release:
    runs-on: ubuntu-latest

    permissions:
      contents: write

    steps:
      - name: Checkout
        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
        with:
          persist-credentials: false

      - name: Create GitHub Release
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          TAG: ${{ github.ref_name }}
        run: gh release create "${TAG}" --generate-notes

Expected vs actual behavior

Expected: gh recognises the *.ghe.com remote as a GitHub host, infers the repository from the checkout, and creates the release using GH_TOKEN, without requiring GH_HOST, GH_REPO, or an interactive login.

Actual: remote resolution fails with the error below. The same workflow worked on GitHub.com, and explicitly setting GH_REPO makes it work on the data-residency instance.

Logs

none of the git remotes configured for this repository point to a known GitHub host. To tell gh about a new GitHub host, please use `gh auth login`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority-2Affects more than a few users but doesn't prevent core functions

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions