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

Function dependabotErrMsg

pkg/github/dependabot.go:219–227  ·  view source on GitHub ↗

dependabotErrMsg enhances error messages for dependabot API failures by appending a hint about token permissions when the response indicates the token may lack access to the repository (403 or 404).

(base, owner, repo string, resp *github.Response)

Source from the content-addressed store, hash-verified

217// appending a hint about token permissions when the response indicates
218// the token may lack access to the repository (403 or 404).
219func dependabotErrMsg(base, owner, repo string, resp *github.Response) string {
220 if resp != nil && (resp.StatusCode == http.StatusForbidden || resp.StatusCode == http.StatusNotFound) {
221 return fmt.Sprintf("%s. Your token may not have access to Dependabot alerts on %s/%s. "+
222 "To access Dependabot alerts, the token needs the 'security_events' scope or, for fine-grained tokens, "+
223 "Dependabot alerts read permission for this specific repository.",
224 base, owner, repo)
225 }
226 return base
227}

Callers 2

GetDependabotAlertFunction · 0.85
ListDependabotAlertsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected