google / go-github

Go library for accessing the GitHub v3 API

Home Page:https://pkg.go.dev/github.com/google/go-github/v62/github

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug: IssueEvent missing the action key

noble-varghese opened this issue · comments

Description

The IssueEvent in issues_event.go file doesn't have the action key that defines the kind of action being performed by the webhook API. Adding this key would give a more robust and rich understanding of the actions themselves.

An examples webhook API request is as follows that was triggered when an issue was edited :

{
  "action": "edited",
  "issue": {
    // omitting the nested-json for brevity  
  },
  "repository": {
    // omitting the nested-json for brevity  
  },
  "sender": {
    // omitting the nested-json for brevity
  }
}

I can also push attach a PR to add this as well some more useful features around the same. Let me know if that is welcomed by the maintainers :)

Thank you, @noble-varghese .

I can also push attach a PR to add this as well some more useful features around the same. Let me know if that is welcomed by the maintainers :)

"It depends." In this repo, we try to strike a balance between providing generally-useful helpers and keeping the maintenance burden low.

What did you have in mind?
Do you find similar examples already in this repo?
How generally-useful are your new features, meaning: will they be useful to a lot of users of this repo or just a few?
How big are these new features in terms of lines-of-code?
How much of a maintenance burden would they add?

Probably the easiest way to answer all these questions would be to put together a separate PR with these changes, then we can discuss and decide based on that PR.

Thanks for taking the time to detail this out @gmlewis.
I will raise a PR adding and detailing the features I have in mind along with the fix and how it would be useful to the users.