diff --git a/.github/workflows/pb-tests.yml b/.github/workflows/pb-tests.yml index ad447808..5b3bed09 100644 --- a/.github/workflows/pb-tests.yml +++ b/.github/workflows/pb-tests.yml @@ -1,5 +1,10 @@ name: Tests "on": + merge_group: + types: + - checks_requested + branches: + - main pull_request: {} push: branches: diff --git a/octo/actions/event/merge_group.go b/octo/actions/event/merge_group.go new file mode 100644 index 00000000..ac6d8d79 --- /dev/null +++ b/octo/actions/event/merge_group.go @@ -0,0 +1,37 @@ +/* + * Copyright 2018-2023 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package event + +const MergeGroupType Type = "merge_group" + +type MergeGroupActivityType string + +const ( + MergeGroupChecksRequested MergeGroupActivityType = "checks_requested" +) + +type MergeGroup struct { + Types []MergeGroupActivityType `yaml:",omitempty"` + Branches []string `yaml:",omitempty"` + BranchesIgnore []string `yaml:"branches-ignore,omitempty"` + Paths []string `yaml:",omitempty"` + PathsIgnore []string `yaml:"paths-ignore,omitempty"` +} + +func (MergeGroup) Type() Type { + return MergeGroupType +} diff --git a/octo/test.go b/octo/test.go index 7217ebaa..24b58b9e 100644 --- a/octo/test.go +++ b/octo/test.go @@ -51,6 +51,10 @@ func ContributeTest(descriptor Descriptor) (*Contribution, error) { event.PushType: event.Push{ Branches: []string{"main"}, }, + event.MergeGroupType: event.MergeGroup{ + Types: []event.MergeGroupActivityType{event.MergeGroupChecksRequested}, + Branches: []string{"main"}, + }, }, Jobs: map[string]actions.Job{}, }