Repository: google/go-github
Pull request #3250 (2024-08-26 16:57:55)

Add Source field to RulesetRepositoryPropertyTargetParameters
Fixes: #3247.

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/google/go-github/pull/3250?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 92.95%. Comparing base [(`2b8c7fa`)](https://app.codecov.io/gh/google/go-github/commit/2b8c7fa86fcd1cb4a89a44c8e7b5a49fe4be8a45?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) to head [(`53da04d`)](https://app.codecov.io/gh/google/go-github/commit/53da04d7b19aeb7bf0ed878a053760ee9f860287?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google).
> Report is 103 commits behind head on master.

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##           master    #3250      +/-   ##
==========================================
- Coverage   97.72%   92.95%   -4.78%     
==========================================
  Files         153      171      +18     
  Lines       13390    11647    -1743     
==========================================
- Hits        13085    10826    -2259     
- Misses        215      727     +512     
- Partials       90       94       +4     
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/google/go-github/pull/3250?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google).


Patch:
diff --git a/github/repos_rules.go b/github/repos_rules.go
index 6d394164..3c6e8f01 100644
--- a/github/repos_rules.go
+++ b/github/repos_rules.go
@@ -52,6 +52,7 @@ type RulesetRepositoryIDsConditionParameters struct {
 type RulesetRepositoryPropertyTargetParameters struct {
 	Name   string   `json:"name"`
 	Values []string `json:"property_values"`
+	Source string   `json:"source"`
 }
 
 // RulesetRepositoryPropertyConditionParameters represents the conditions object for repository_property.


Test patch:
diff --git a/github/orgs_rules_test.go b/github/orgs_rules_test.go
index d45469f2..13d4c76d 100644
--- a/github/orgs_rules_test.go
+++ b/github/orgs_rules_test.go
@@ -555,12 +555,14 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing.
 				Include: []RulesetRepositoryPropertyTargetParameters{
 					{
 						Name:   "testIncludeProp",
+						Source: "custom",
 						Values: []string{"true"},
 					},
 				},
 				Exclude: []RulesetRepositoryPropertyTargetParameters{
 					{
 						Name:   "testExcludeProp",
+						Source: "custom",
 						Values: []string{"false"},
 					},
 				},
@@ -647,12 +649,14 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoProperty(t *testing.
 				Include: []RulesetRepositoryPropertyTargetParameters{
 					{
 						Name:   "testIncludeProp",
+						Source: "custom",
 						Values: []string{"true"},
 					},
 				},
 				Exclude: []RulesetRepositoryPropertyTargetParameters{
 					{
 						Name:   "testExcludeProp",
+						Source: "custom",
 						Values: []string{"false"},
 					},
 				},
@@ -1206,6 +1210,7 @@ func TestOrganizationsService_GetOrganizationRulesetWithRepoPropCondition(t *tes
 				Include: []RulesetRepositoryPropertyTargetParameters{
 					{
 						Name:   "testIncludeProp",
+						Source: "custom",
 						Values: []string{"true"},
 					},
 				},
@@ -1397,6 +1402,7 @@ func TestOrganizationsService_UpdateOrganizationRulesetWithRepoProp(t *testing.T
 				Include: []RulesetRepositoryPropertyTargetParameters{
 					{
 						Name:   "testIncludeProp",
+						Source: "custom",
 						Values: []string{"true"},
 					},
 				},
@@ -1428,6 +1434,7 @@ func TestOrganizationsService_UpdateOrganizationRulesetWithRepoProp(t *testing.T
 				Include: []RulesetRepositoryPropertyTargetParameters{
 					{
 						Name:   "testIncludeProp",
+						Source: "custom",
 						Values: []string{"true"},
 					},
 				},