From a6806bc71d514c2104a596dd44ebe74830adf330 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 17:05:28 -0400 Subject: [PATCH 1/3] Bump codecov/codecov-action from 4.2.0 to 4.3.0 (#3128) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index da8143a7ae..efac3df3d9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -73,4 +73,4 @@ jobs: - name: Upload coverage to Codecov if: ${{ matrix.update-coverage }} - uses: codecov/codecov-action@7afa10ed9b269c561c2336fd862446844e0cbf71 #v4.2.0 + uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed #v4.3.0 From b02f283714b9150fd31eaa60bc805814f50a1447 Mon Sep 17 00:00:00 2001 From: Matthew William Reidy <48036844+Matthew-Reidy@users.noreply.github.com> Date: Thu, 18 Apr 2024 18:25:10 -0700 Subject: [PATCH 2/3] Add support for merge queue ruleset JSON unmarshaling (#3131) Fixes: #3098. --- AUTHORS | 3 ++- github/orgs_rules_test.go | 10 ++++++++++ github/repos_rules.go | 9 ++++++++- github/repos_rules_test.go | 7 +++++++ 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/AUTHORS b/AUTHORS index 74a21dc604..0197b94a23 100644 --- a/AUTHORS +++ b/AUTHORS @@ -303,6 +303,7 @@ Matt Gaunt Matt Landis Matt Moore Matt Simons +Matthew Reidy Maxime Bury Michael Meng Michael Spiegel @@ -484,4 +485,4 @@ Zach Latta zhouhaibing089 六开箱 缘生 -蒋航 +蒋航 \ No newline at end of file diff --git a/github/orgs_rules_test.go b/github/orgs_rules_test.go index 50ba4e20c0..0ed54ca8d2 100644 --- a/github/orgs_rules_test.go +++ b/github/orgs_rules_test.go @@ -123,6 +123,9 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) { "type": "deletion" }, + { + "type": "merge_queue" + }, { "type": "required_linear_history" }, @@ -238,6 +241,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) UpdateAllowsFetchAndMerge: true, }), NewDeletionRule(), + NewMergeQueueRule(), NewRequiredLinearHistoryRule(), NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ RequiredDeploymentEnvironments: []string{"test"}, @@ -324,6 +328,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) UpdateAllowsFetchAndMerge: true, }), NewDeletionRule(), + NewMergeQueueRule(), NewRequiredLinearHistoryRule(), NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ RequiredDeploymentEnvironments: []string{"test"}, @@ -437,6 +442,9 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { { "type": "deletion" }, + { + "type": "merge_queue" + }, { "type": "required_linear_history" }, @@ -550,6 +558,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { UpdateAllowsFetchAndMerge: true, }), NewDeletionRule(), + NewMergeQueueRule(), NewRequiredLinearHistoryRule(), NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ RequiredDeploymentEnvironments: []string{"test"}, @@ -634,6 +643,7 @@ func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) { UpdateAllowsFetchAndMerge: true, }), NewDeletionRule(), + NewMergeQueueRule(), NewRequiredLinearHistoryRule(), NewRequiredDeploymentsRule(&RequiredDeploymentEnvironmentsRuleParameters{ RequiredDeploymentEnvironments: []string{"test"}, diff --git a/github/repos_rules.go b/github/repos_rules.go index 34711dda97..6f046a356a 100644 --- a/github/repos_rules.go +++ b/github/repos_rules.go @@ -134,7 +134,7 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { r.Type = RepositoryRule.Type switch RepositoryRule.Type { - case "creation", "deletion", "required_linear_history", "required_signatures", "non_fast_forward": + case "creation", "deletion", "merge_queue", "non_fast_forward", "required_linear_history", "required_signatures": r.Parameters = nil case "update": if RepositoryRule.Parameters == nil { @@ -210,6 +210,13 @@ func (r *RepositoryRule) UnmarshalJSON(data []byte) error { return nil } +// NewMergeQueueRule creates a rule to only allow merges via a merge queue. +func NewMergeQueueRule() (rule *RepositoryRule) { + return &RepositoryRule{ + Type: "merge_queue", + } +} + // NewCreationRule creates a rule to only allow users with bypass permission to create matching refs. func NewCreationRule() (rule *RepositoryRule) { return &RepositoryRule{ diff --git a/github/repos_rules_test.go b/github/repos_rules_test.go index cbc3e5ce61..23ffd3ed5c 100644 --- a/github/repos_rules_test.go +++ b/github/repos_rules_test.go @@ -67,6 +67,13 @@ func TestRepositoryRule_UnmarshalJSON(t *testing.T) { Parameters: nil, }, }, + "Valid merge_queue": { + data: `{"type":"merge_queue"}`, + want: &RepositoryRule{ + Type: "merge_queue", + Parameters: nil, + }, + }, "Valid non_fast_forward": { data: `{"type":"non_fast_forward"}`, want: &RepositoryRule{ From 8d4be0b2cf2b8242a0b7e3777232cd0058ae535f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Apr 2024 09:16:31 -0400 Subject: [PATCH 3/3] Bump golang.org/x/net from 0.17.0 to 0.23.0 in /example (#3134) --- example/go.mod | 8 ++++---- example/go.sum | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/example/go.mod b/example/go.mod index 5b11139f25..0213a527e0 100644 --- a/example/go.mod +++ b/example/go.mod @@ -7,8 +7,8 @@ require ( github.com/bradleyfalzon/ghinstallation/v2 v2.0.4 github.com/gofri/go-github-ratelimit v1.0.3 github.com/google/go-github/v61 v61.0.0 - golang.org/x/crypto v0.17.0 - golang.org/x/term v0.15.0 + golang.org/x/crypto v0.21.0 + golang.org/x/term v0.18.0 google.golang.org/appengine v1.6.7 ) @@ -18,8 +18,8 @@ require ( github.com/golang/protobuf v1.5.2 // indirect github.com/google/go-github/v41 v41.0.0 // indirect github.com/google/go-querystring v1.1.0 // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/sys v0.15.0 // indirect + golang.org/x/net v0.23.0 // indirect + golang.org/x/sys v0.18.0 // indirect google.golang.org/protobuf v1.33.0 // indirect ) diff --git a/example/go.sum b/example/go.sum index d8e05e5653..7e3d174968 100644 --- a/example/go.sum +++ b/example/go.sum @@ -30,8 +30,8 @@ golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= -golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= @@ -41,8 +41,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -56,15 +56,15 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= -golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= -golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= +golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=