MCPcopy
hub / github.com/ossf/scorecard / GetOrgRepoClient

Method GetOrgRepoClient

clients/githubrepo/client.go:266–285  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

264}
265
266func (client *Client) GetOrgRepoClient(ctx context.Context) (clients.RepoClient, error) {
267 dotGithubRepo, err := MakeGithubRepo(fmt.Sprintf("%s/.github", client.repourl.owner))
268 if err != nil {
269 return nil, fmt.Errorf("error during MakeGithubRepo: %w", err)
270 }
271
272 options := []Option{WithRoundTripper(client.repoClient.Client().Transport)}
273 if client.gitMode {
274 options = append(options, WithFileModeGit())
275 }
276 c, err := NewRepoClient(ctx, options...)
277 if err != nil {
278 return nil, fmt.Errorf("create org repoclient: %w", err)
279 }
280 if err := c.InitRepo(dotGithubRepo, clients.HeadSHA, 0); err != nil {
281 return nil, fmt.Errorf("error during InitRepo: %w", err)
282 }
283
284 return c, nil
285}
286
287// ListWebhooks implements RepoClient.ListWebhooks.
288func (client *Client) ListWebhooks() ([]clients.Webhook, error) {

Callers

nothing calls this directly

Calls 5

InitRepoMethod · 0.95
MakeGithubRepoFunction · 0.85
WithRoundTripperFunction · 0.85
NewRepoClientFunction · 0.85
WithFileModeGitFunction · 0.70

Tested by

no test coverage detected