@@ -15,13 +15,16 @@ import (
1515type Metric struct {
1616 Name * string `json:"name"`
1717 Key * string `json:"key"`
18+ SPDXID * string `json:"spdx_id"`
1819 URL * string `json:"url"`
1920 HTMLURL * string `json:"html_url"`
21+ NodeID * string `json:"node_id"`
2022}
2123
2224// CommunityHealthFiles represents the different files in the community health metrics response.
2325type CommunityHealthFiles struct {
2426 CodeOfConduct * Metric `json:"code_of_conduct"`
27+ CodeOfConductFile * Metric `json:"code_of_conduct_file"`
2528 Contributing * Metric `json:"contributing"`
2629 IssueTemplate * Metric `json:"issue_template"`
2730 PullRequestTemplate * Metric `json:"pull_request_template"`
@@ -31,24 +34,24 @@ type CommunityHealthFiles struct {
3134
3235// CommunityHealthMetrics represents a response containing the community metrics of a repository.
3336type CommunityHealthMetrics struct {
34- HealthPercentage * int `json:"health_percentage"`
35- Files * CommunityHealthFiles `json:"files"`
36- UpdatedAt * time.Time `json:"updated_at"`
37+ HealthPercentage * int `json:"health_percentage"`
38+ Description * string `json:"description"`
39+ Documentation * string `json:"documentation"`
40+ Files * CommunityHealthFiles `json:"files"`
41+ UpdatedAt * time.Time `json:"updated_at"`
42+ ContentReportsEnabled * bool `json:"content_reports_enabled"`
3743}
3844
3945// GetCommunityHealthMetrics retrieves all the community health metrics for a repository.
4046//
41- // GitHub API docs: https://docs.github.com/en/free-pro-team@latest/ rest/reference/repos/ #get-community-profile-metrics
47+ // GitHub API docs: https://docs.github.com/en/rest/reference/repos#get-community-profile-metrics
4248func (s * RepositoriesService ) GetCommunityHealthMetrics (ctx context.Context , owner , repo string ) (* CommunityHealthMetrics , * Response , error ) {
4349 u := fmt .Sprintf ("repos/%v/%v/community/profile" , owner , repo )
4450 req , err := s .client .NewRequest ("GET" , u , nil )
4551 if err != nil {
4652 return nil , nil , err
4753 }
4854
49- // TODO: remove custom Accept header when this API fully launches.
50- req .Header .Set ("Accept" , mediaTypeRepositoryCommunityHealthMetricsPreview )
51-
5255 metrics := & CommunityHealthMetrics {}
5356 resp , err := s .client .Do (ctx , req , metrics )
5457 if err != nil {
0 commit comments