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

Function buildContentsAPIPath

pkg/parser/remote_fetch.go:966–978  ·  view source on GitHub ↗
(owner, repo, path, ref string)

Source from the content-addressed store, hash-verified

964}
965
966func buildContentsAPIPath(owner, repo, path, ref string) string {
967 pathSegments := strings.Split(path, "/")
968 for i := range pathSegments {
969 pathSegments[i] = url.PathEscape(pathSegments[i])
970 }
971 return fmt.Sprintf(
972 "repos/%s/%s/contents/%s?ref=%s",
973 owner,
974 repo,
975 strings.Join(pathSegments, "/"),
976 url.QueryEscape(ref),
977 )
978}
979
980func fetchRemoteFileContent(client *api.RESTClient, owner, repo, path, ref string, fileContent any) error {
981 return client.Get(buildContentsAPIPath(owner, repo, path, ref), fileContent)

Callers 7

checkRemoteSymlinkFunction · 0.85
fetchRemoteFileContentFunction · 0.85
listWorkflowFilesForHostFunction · 0.85
listDirAllFilesForHostFunction · 0.85
listDirSubdirsForHostFunction · 0.85
TestBuildContentsAPIPathFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestBuildContentsAPIPathFunction · 0.68