diff --git a/vendor/github.com/google/go-github/v29/github/repos.go b/vendor/github.com/google/go-github/v29/github/repos.go index 5aa56006ee..6414fd8da7 100644 --- a/vendor/github.com/google/go-github/v29/github/repos.go +++ b/vendor/github.com/google/go-github/v29/github/repos.go @@ -578,6 +578,26 @@ func (s *RepositoriesService) DisableVulnerabilityAlerts(ctx context.Context, ow return s.client.Do(ctx, req, nil) } +// GetVulnerabilityAlerts checks if vulnerability alerts are enabled for a repository. +// +// GitHub API docs: https://developer.github.com/v3/repos/#check-if-vulnerability-alerts-are-enabled-for-a-repository +func (s *RepositoriesService) GetVulnerabilityAlerts(ctx context.Context, owner, repository string) (bool, *Response, error) { + u := fmt.Sprintf("repos/%v/%v/vulnerability-alerts", owner, repository) + + req, err := s.client.NewRequest("GET", u, nil) + if err != nil { + return false, nil, err + } + + // TODO: remove custom Accept header when this API fully launches + req.Header.Set("Accept", mediaTypeRequiredVulnerabilityAlertsPreview) + + resp, err := s.client.Do(ctx, req, nil) + vulnerabilityAlertsEnabled, err := parseBoolResponse(err) + + return vulnerabilityAlertsEnabled, resp, err +} + // EnableAutomatedSecurityFixes enables the automated security fixes for a repository. // // GitHub API docs: https://developer.github.com/v3/repos/#enable-automated-security-fixes