MCPcopy Create free account
hub / github.com/github/gh-aw / DownloadFileFromGitHubForHost

Function DownloadFileFromGitHubForHost

pkg/parser/remote_fetch.go:885–887  ·  view source on GitHub ↗

DownloadFileFromGitHubForHost downloads a file from a GitHub repository using the GitHub API, targeting a specific GitHub host. Use this when the target repository is on a different host than the one configured via GH_HOST (e.g., fetching from github.com while GH_HOST is a GHE instance). host is the

(owner, repo, path, ref, host string)

Source from the content-addressed store, hash-verified

883// host is the hostname without scheme (e.g., "github.com", "myorg.ghe.com").
884// An empty host uses the default configured host (GH_HOST or github.com).
885func DownloadFileFromGitHubForHost(owner, repo, path, ref, host string) ([]byte, error) {
886 return downloadFileFromGitHubWithDepth(owner, repo, path, ref, 0, host)
887}
888
889// ResolveRefToSHAForHost resolves a git ref to its full commit SHA on a specific GitHub host.
890// Use this when the target repository is on a different host than the one configured via GH_HOST.

Calls 1

Tested by

no test coverage detected