Repository: google/go-github
Pull request #3040 (2024-01-08 18:58:18)

Add Repo and Action to IssueEvent
# Description
The IssueEvent was missing the details of `action` and `repository`. 

Issue: #3038 
Related Issue: Similar issue was also reported in #768

google-cla[bot]: Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this [failed invocation](https://github.com/google/go-github/pull/3040/checks?check_run_id=20274111952) of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.
codecov[bot]: ## [Codecov](https://app.codecov.io/gh/google/go-github/pull/3040?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Comparison is base [(`b40c811`)](https://app.codecov.io/gh/google/go-github/commit/b40c811fdcd3abbf6423486e8528a86ee7c1cf45?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) 97.71% compared to head [(`9912f71`)](https://app.codecov.io/gh/google/go-github/pull/3040?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) 97.71%.


<details><summary>Additional details and impacted files</summary>


```diff
@@           Coverage Diff           @@
##           master    #3040   +/-   ##
=======================================
  Coverage   97.71%   97.71%           
=======================================
  Files         152      152           
  Lines       13241    13241           
=======================================
  Hits        12939    12939           
  Misses        213      213           
  Partials       89       89           
```



</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/google/go-github/pull/3040?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google).


Patch:
diff --git a/github/github-accessors.go b/github/github-accessors.go
index 3f24a795..256bfacf 100644
--- a/github/github-accessors.go
+++ b/github/github-accessors.go
@@ -9510,6 +9510,14 @@ func (i *IssueEvent) GetRename() *Rename {
 	return i.Rename
 }
 
+// GetRepository returns the Repository field.
+func (i *IssueEvent) GetRepository() *Repository {
+	if i == nil {
+		return nil
+	}
+	return i.Repository
+}
+
 // GetRequestedReviewer returns the RequestedReviewer field.
 func (i *IssueEvent) GetRequestedReviewer() *User {
 	if i == nil {
diff --git a/github/issues_events.go b/github/issues_events.go
index 23a16bcd..bba3b180 100644
--- a/github/issues_events.go
+++ b/github/issues_events.go
@@ -18,6 +18,9 @@ type IssueEvent struct {
 	// The User that generated this event.
 	Actor *User `json:"actor,omitempty"`
 
+	// The action corresponding to the event.
+	Action string `json:"action,omitempty"`
+
 	// Event identifies the actual type of Event that occurred. Possible
 	// values are:
 	//
@@ -74,6 +77,7 @@ type IssueEvent struct {
 	Issue     *Issue     `json:"issue,omitempty"`
 
 	// Only present on certain events; see above.
+	Repository            *Repository      `json:"repository,omitempty"`
 	Assignee              *User            `json:"assignee,omitempty"`
 	Assigner              *User            `json:"assigner,omitempty"`
 	CommitID              *string          `json:"commit_id,omitempty"`


Test patch:
diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go
index e575fea2..461ce8ed 100644
--- a/github/github-accessors_test.go
+++ b/github/github-accessors_test.go
@@ -11096,6 +11096,13 @@ func TestIssueEvent_GetRename(tt *testing.T) {
 	i.GetRename()
 }
 
+func TestIssueEvent_GetRepository(tt *testing.T) {
+	i := &IssueEvent{}
+	i.GetRepository()
+	i = nil
+	i.GetRepository()
+}
+
 func TestIssueEvent_GetRequestedReviewer(tt *testing.T) {
 	i := &IssueEvent{}
 	i.GetRequestedReviewer()