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

Function DownloadFileFromGitHub

pkg/parser/remote_fetch.go:876–878  ·  view source on GitHub ↗

DownloadFileFromGitHub downloads a file from a GitHub repository using the GitHub API. This is the exported wrapper for downloadFileFromGitHub. Parameters: - owner: Repository owner (e.g., "github") - repo: Repository name (e.g., "gh-aw") - path: Path to the file within the repository (e.g., ".githu

(owner, repo, path, ref string)

Source from the content-addressed store, hash-verified

874// - ref: Git reference (branch, tag, or commit SHA)
875// Returns the file content as bytes or an error if the file cannot be retrieved.
876func DownloadFileFromGitHub(owner, repo, path, ref string) ([]byte, error) {
877 return downloadFileFromGitHubWithDepth(owner, repo, path, ref, 0, "")
878}
879
880// DownloadFileFromGitHubForHost downloads a file from a GitHub repository using the GitHub API,
881// targeting a specific GitHub host. Use this when the target repository is on a different host

Calls 1

Tested by

no test coverage detected