Skip to content

Commit 991a341

Browse files
authored
Add reason parameter to MergeGroupEvent (#3508)
1 parent 56f5036 commit 991a341

File tree

4 files changed

+24
-1
lines changed

4 files changed

+24
-1
lines changed

github/event_types.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,8 +858,10 @@ type MergeGroup struct {
858858
//
859859
// GitHub API docs: https://docs.github.com/developers/webhooks-and-events/webhook-events-and-payloads#merge_group
860860
type MergeGroupEvent struct {
861-
// The action that was performed. Currently, can only be checks_requested.
861+
// The action that was performed. Possible values are: "checks_requested", "destroyed".
862862
Action *string `json:"action,omitempty"`
863+
// Reason is populated when the action is "destroyed". Possible values: "merged", "invalidated", "dequeued".
864+
Reason *string `json:"reason,omitempty"`
863865
// The merge group.
864866
MergeGroup *MergeGroup `json:"merge_group,omitempty"`
865867

github/event_types_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10746,6 +10746,7 @@ func TestMergeGroupEvent_Marshal(t *testing.T) {
1074610746

1074710747
u := &MergeGroupEvent{
1074810748
Action: Ptr("a"),
10749+
Reason: Ptr("r"),
1074910750
MergeGroup: &MergeGroup{
1075010751
HeadSHA: Ptr("hs"),
1075110752
HeadRef: Ptr("hr"),
@@ -10886,6 +10887,7 @@ func TestMergeGroupEvent_Marshal(t *testing.T) {
1088610887

1088710888
want := `{
1088810889
"action": "a",
10890+
"reason": "r",
1088910891
"merge_group": {
1089010892
"head_sha": "hs",
1089110893
"head_ref": "hr",

github/github-accessors.go

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/github-accessors_test.go

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)