cli/pkg/cmd/attestation/auth/host.go
Meredith Lancaster af90403ecb check user's GH host for compatibility
Signed-off-by: Meredith Lancaster <malancas@github.com>
2024-03-05 09:53:36 -07:00

17 lines
385 B
Go

package auth
import (
"errors"
"github.com/cli/go-gh/v2/pkg/auth"
)
var ErrUnsupportedHost = errors.New("The GH_HOST environment variable is set to a custom GitHub host. gh attestation does not currently support custom GitHub Enterprise hosts")
func IsHostSupported() error {
host, _ := auth.DefaultHost()
if host != "github.com" {
return ErrUnsupportedHost
}
return nil
}