MCPcopy Create free account
hub / github.com/google/go-github / GetVulnerabilityAlerts

Method GetVulnerabilityAlerts

github/repos.go:806–819  ·  view source on GitHub ↗

GetVulnerabilityAlerts checks if vulnerability alerts are enabled for a repository. GitHub API docs: https://docs.github.com/rest/repos/repos?apiVersion=2022-11-28#check-if-vulnerability-alerts-are-enabled-for-a-repository meta:operation GET /repos/{owner}/{repo}/vulnerability-alerts

(ctx context.Context, owner, repository string)

Source from the content-addressed store, hash-verified

804//
805//meta:operation GET /repos/{owner}/{repo}/vulnerability-alerts
806func (s *RepositoriesService) GetVulnerabilityAlerts(ctx context.Context, owner, repository string) (bool, *Response, error) {
807 u := fmt.Sprintf("repos/%v/%v/vulnerability-alerts", owner, repository)
808
809 req, err := s.client.NewRequest(ctx, "GET", u, nil)
810 if err != nil {
811 return false, nil, err
812 }
813
814 req.Header.Set("Accept", mediaTypeRequiredVulnerabilityAlertsPreview)
815
816 resp, err := s.client.Do(req, nil)
817 vulnerabilityAlertsEnabled, err := parseBoolResponse(err)
818 return vulnerabilityAlertsEnabled, resp, err
819}
820
821// EnableVulnerabilityAlerts enables vulnerability alerts and the dependency graph for a repository.
822//

Calls 3

parseBoolResponseFunction · 0.85
NewRequestMethod · 0.80
DoMethod · 0.45