Skip to content

Commit

Permalink
Merge pull request #1061 from paketo-buildpacks/gh_1036
Browse files Browse the repository at this point in the history
Add support for merge queues
  • Loading branch information
dmikusa committed Mar 22, 2023
2 parents ae533a5 + be36066 commit 17f0456
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/pb-tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: Tests
"on":
merge_group:
types:
- checks_requested
branches:
- main
pull_request: {}
push:
branches:
Expand Down
37 changes: 37 additions & 0 deletions octo/actions/event/merge_group.go
Original file line number Diff line number Diff line change
@@ -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
}
4 changes: 4 additions & 0 deletions octo/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{},
}
Expand Down

0 comments on commit 17f0456

Please sign in to comment.