feat: Support Changes and Enterprise fields on ReleaseEvent - #4558
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4558 +/- ##
=======================================
Coverage 98.57% 98.57%
=======================================
Files 197 197
Lines 18291 18291
=======================================
Hits 18030 18030
Misses 261 261 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
gmlewis
left a comment
There was a problem hiding this comment.
Thank you, @rksharma-owg!
LGTM.
Awaiting second LGTM+Approval from any other contributor to this repo before merging.
|
Thank you for the review and approval, @gmlewis! |
|
|
||
| // ReleaseChangeFrom represents a release string field change containing the previous value. | ||
| type ReleaseChangeFrom struct { | ||
| From *string `json:"from,omitempty"` |
There was a problem hiding this comment.
Updated ReleaseChangeFrom.From to non-pointer string with json:"from" and regenerated accessors/tests in 8efa573. Thanks for pointing this out!
|
|
||
| // ReleaseChangeToBool represents a boolean release field change containing the new value. | ||
| type ReleaseChangeToBool struct { | ||
| To *bool `json:"to,omitempty"` |
There was a problem hiding this comment.
| To *bool `json:"to,omitempty"` | |
| To bool `json:"to"` |
There was a problem hiding this comment.
Updated to bool with json:"to" and regenerated accessors/tests in 75b7d21. Thanks!
|
|
||
| event, ok := got.(*ReleaseEvent) | ||
| if !ok { | ||
| t.Fatalf("ParseWebHook returned %T, want *ReleaseEvent", got) |
There was a problem hiding this comment.
| t.Fatalf("ParseWebHook returned %T, want *ReleaseEvent", got) | |
| t.Fatalf("ParseWebHook returned %v, want *ReleaseEvent", got) |
There was a problem hiding this comment.
Updated format specifier to %v in 75b7d21. Thanks!
|
Thank you, @Not-Dhananjay-Mishra! |

The
releasewebhook event is delivered when a release is published, unpublished, created, edited, deleted, prereleased, or released.This PR adds:
Changes *ReleaseChangestoReleaseEvent(json:"changes,omitempty"):GitHub delivers a
changesobject when theeditedaction is triggered, containing previous values forbody,name,tag_name, and the new value formake_latest.Enterprise *EnterprisetoReleaseEvent(json:"enterprise,omitempty"):Present when the webhook is triggered on a repository belonging to an enterprise.
ReleaseEventto include the"released"action.ReleaseChanges,ReleaseChangeFrom, andReleaseChangeToBool../script/generate.sh.github/messages_test.go(TestParseWebHook_ReleaseEvent_Edited).References: