{"record":{"id":"d96f90ec46fca7d8","repo":"cli/cli","slug":"errunsupportedhost","errorCode":"ErrUnsupportedHost","errorMessage":"An unsupported host was detected. Note that gh attestation does not currently support GHES","messagePattern":"An unsupported host was detected\\. Note that gh attestation does not currently support GHES","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/cmd/attestation/auth/host.go","lineNumber":9,"sourceCode":"package auth\n\nimport (\n\t\"errors\"\n\n\tghauth \"github.com/cli/go-gh/v2/pkg/auth\"\n)\n\nvar ErrUnsupportedHost = errors.New(\"An unsupported host was detected. Note that gh attestation does not currently support GHES\")\n\nfunc IsHostSupported(host string) error {\n\tif ghauth.IsEnterprise(host) {\n\t\treturn ErrUnsupportedHost\n\t}\n\treturn nil\n}\n","sourceCodeStart":1,"sourceCodeEnd":17,"githubUrl":"https://github.com/cli/cli/blob/0eeec0b92edbe70199f9768522f831d3534f41ad/pkg/cmd/attestation/auth/host.go#L1-L17","documentation":"ErrUnsupportedHost is a sentinel in pkg/cmd/attestation/auth/host.go returned by IsHostSupported when ghauth.IsEnterprise(host) is true. The gh attestation command family only works against GitHub.com because artifact attestations and the attestation API are not available on GitHub Enterprise Server (GHES). Any attestation subcommand run while authenticated to an enterprise host fails fast with this error.","triggerScenarios":"Running gh attestation verify/download while the active host (from --hostname or the default auth host) resolves to a GHES instance, e.g. gh.example.com. Also when GH_HOST is set to an enterprise hostname or the repo remote points at GHES.","commonSituations":"Corporate environment using GHES; GH_HOST env var inherited from another tooling; being logged into both github.com and GHES with GHES active; scripts written for github.com reused in an enterprise context.","solutions":["Target github.com explicitly: gh attestation verify <artifact> --hostname github.com.","If logged into multiple hosts, set the default: gh auth switch --hostname github.com.","Unset or correct GH_HOST for the command (GH_HOST=github.com gh attestation ...).","If GHES support is required, track the upstream issue; there is no workaround because the API itself is absent on GHES."],"exampleFix":"# before\n$ GH_HOST=gh.corp.example.com gh attestation verify artifact.bin\n# error: An unsupported host was detected...\n\n# after\n$ gh attestation verify artifact.bin --hostname github.com","handlingStrategy":"validation","validationCode":"# guard the invocation\nif gh auth status 2>&1 | grep -q GHES_HOST_NAME; then\n  echo \"attestations unsupported on GHES; skipping\"; exit 0\nfi\ngh attestation verify ...","typeGuard":"if err := auth.IsHostSupported(hostname); err != nil {\n    if errors.Is(err, auth.ErrUnsupportedHost) { /* skip or fail with guidance */ }\n}","tryCatchPattern":"if err := auth.IsHostSupported(host); err != nil {\n    if errors.Is(err, auth.ErrUnsupportedHost) {\n        return fmt.Errorf(\"skipping attestation verification: %w\", err)\n    }\n    return err\n}","preventionTips":["Pin --hostname github.com in scripts that run in mixed environments.","Check gh auth status output for enterprise hosts before calling attestation commands.","Gate attestation steps in CI on the GitHub.com host condition."],"tags":["attestation","ghes","host","feature-support"],"backgroundTag":null,"analyzedSha":"0eeec0b92edbe70199f9768522f831d3534f41ad","analyzedAt":"2026-08-15T12:31:05.478Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}