nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: google/go-github
Pull request #3245 (2024-08-22 03:27:44)

feat: Add do_not_enforce_on_create to required status checks rule params
Fixes: #3244.

I signed the CLA. The `fmt` `test` and `lint` scripts all passed without warnings.

gmlewis: > I signed the CLA. The `fmt` `test` and `lint` scripts all passed without warnings.

It looks like GitHub Actions disagrees:

```
--- FAIL: TestRepositoryRule_UnmarshalJSON (0.01s)
    --- FAIL: TestRepositoryRule_UnmarshalJSON/Valid_required_status_checks_params (0.00s)
        repos_rules_test.go:287: RepositoryRule.UnmarshalJSON expected rule &{Type:required_status_checks Parameters:0xc0004208d0 RulesetSourceType: RulesetSource: RulesetID:0}, got &{Type:required_status_checks Parameters:0xc000420d20 RulesetSourceType: RulesetSource: RulesetID:0}
```

Can you please update this test and push the changes to this PR?
(There's no need to force-push in this repo because we always squash-and-merge each PR.)

Thank you, @MattMencel !

MattMencel: > > I signed the CLA. The `fmt` `test` and `lint` scripts all passed without warnings.
> 
> It looks like GitHub Actions disagrees:

Whoopsies.... well they do now. 😄 


Patch:
diff --git a/github/repos_rules.go b/github/repos_rules.go
index 17fa170c..6d394164 100644
--- a/github/repos_rules.go
+++ b/github/repos_rules.go
@@ -111,6 +111,7 @@ type RuleRequiredStatusChecks struct {
 
 // RequiredStatusChecksRuleParameters represents the required_status_checks rule parameters.
 type RequiredStatusChecksRuleParameters struct {
+	DoNotEnforceOnCreate             bool                       `json:"do_not_enforce_on_create"`
 	RequiredStatusChecks             []RuleRequiredStatusChecks `json:"required_status_checks"`
 	StrictRequiredStatusChecksPolicy bool                       `json:"strict_required_status_checks_policy"`
 }


Test patch:
diff --git a/github/repos_rules_test.go b/github/repos_rules_test.go
index c338e37e..92f7259d 100644
--- a/github/repos_rules_test.go
+++ b/github/repos_rules_test.go
@@ -224,8 +224,9 @@ func TestRepositoryRule_UnmarshalJSON(t *testing.T) {
 			wantErr: true,
 		},
 		"Valid required_status_checks params": {
-			data: `{"type":"required_status_checks","parameters":{"required_status_checks":[{"context":"test","integration_id":1}],"strict_required_status_checks_policy":true}}`,
+			data: `{"type":"required_status_checks","parameters":{"required_status_checks":[{"context":"test","integration_id":1}],"strict_required_status_checks_policy":true,"do_not_enforce_on_create":true}}`,
 			want: NewRequiredStatusChecksRule(&RequiredStatusChecksRuleParameters{
+				DoNotEnforceOnCreate: true,
 				RequiredStatusChecks: []RuleRequiredStatusChecks{
 					{
 						Context:       "test",