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)
| 804 | // |
| 805 | //meta:operation GET /repos/{owner}/{repo}/vulnerability-alerts |
| 806 | func (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 | // |