MCPcopy Index your code
hub / github.com/github/github-mcp-server / FetchProjectIsPrivate

Function FetchProjectIsPrivate

pkg/github/projects.go:957–969  ·  view source on GitHub ↗

FetchProjectIsPrivate returns whether a GitHub Project is private.

(ctx context.Context, client *github.Client, owner, ownerType string, projectNumber int)

Source from the content-addressed store, hash-verified

955
956// FetchProjectIsPrivate returns whether a GitHub Project is private.
957func FetchProjectIsPrivate(ctx context.Context, client *github.Client, owner, ownerType string, projectNumber int) (bool, error) {
958 project, resp, err := fetchProjectV2(ctx, client, owner, ownerType, projectNumber)
959 if resp != nil && resp.Body != nil {
960 defer func() { _ = resp.Body.Close() }()
961 }
962 if err != nil {
963 return false, err
964 }
965 if resp == nil || resp.StatusCode != http.StatusOK {
966 return false, fmt.Errorf("failed to fetch project visibility")
967 }
968 return !project.GetPublic(), nil
969}
970
971func getProject(ctx context.Context, client *github.Client, owner, ownerType string, projectNumber int) (*mcp.CallToolResult, bool, any, error) {
972 project, resp, err := fetchProjectV2(ctx, client, owner, ownerType, projectNumber)

Callers 2

ProjectsListFunction · 0.85
ProjectsGetFunction · 0.85

Calls 2

fetchProjectV2Function · 0.85
CloseMethod · 0.80

Tested by

no test coverage detected