Repository: google/go-github
Pull request #1838 (2021-03-31 19:04:16)

Update hook_id to int64
Fixes: #1837.


gmlewis: @lindluni - PTAL.
codecov[bot]: # [Codecov](https://codecov.io/gh/google/go-github/pull/1838?src=pr&el=h1) Report
> Merging [#1838](https://codecov.io/gh/google/go-github/pull/1838?src=pr&el=desc) (f15cb6e) into [master](https://codecov.io/gh/google/go-github/commit/3130b78e12cc884ef999b80caca57a34b1af34a5?el=desc) (3130b78) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/google/go-github/pull/1838/graphs/tree.svg?width=650&height=150&src=pr&token=EgYjGjZlI0)](https://codecov.io/gh/google/go-github/pull/1838?src=pr&el=tree)

```diff
@@           Coverage Diff           @@
##           master    #1838   +/-   ##
=======================================
  Coverage   97.56%   97.56%           
=======================================
  Files         104      104           
  Lines        6602     6602           
=======================================
  Hits         6441     6441           
  Misses         87       87           
  Partials       74       74           
```


| [Impacted Files](https://codecov.io/gh/google/go-github/pull/1838?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [github/orgs\_audit\_log.go](https://codecov.io/gh/google/go-github/pull/1838/diff?src=pr&el=tree#diff-Z2l0aHViL29yZ3NfYXVkaXRfbG9nLmdv) | `100.00% <ø> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/google/go-github/pull/1838?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/google/go-github/pull/1838?src=pr&el=footer). Last update [3130b78...f15cb6e](https://codecov.io/gh/google/go-github/pull/1838?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/github/github-accessors.go b/github/github-accessors.go
index d6e13c1b..86ca2526 100644
--- a/github/github-accessors.go
+++ b/github/github-accessors.go
@@ -701,9 +701,9 @@ func (a *AuditEntry) GetHeadSHA() string {
 }
 
 // GetHookID returns the HookID field if it's non-nil, zero value otherwise.
-func (a *AuditEntry) GetHookID() string {
+func (a *AuditEntry) GetHookID() int64 {
 	if a == nil || a.HookID == nil {
-		return ""
+		return 0
 	}
 	return *a.HookID
 }
diff --git a/github/orgs_audit_log.go b/github/orgs_audit_log.go
index e91f0009..81f0edac 100644
--- a/github/orgs_audit_log.go
+++ b/github/orgs_audit_log.go
@@ -53,7 +53,7 @@ type AuditEntry struct {
 	Fingerprint           *string     `json:"fingerprint,omitempty"`
 	HeadBranch            *string     `json:"head_branch,omitempty"`
 	HeadSHA               *string     `json:"head_sha,omitempty"`
-	HookID                *string     `json:"hook_id,omitempty"`
+	HookID                *int64      `json:"hook_id,omitempty"`
 	IsHostedRunner        *bool       `json:"is_hosted_runner,omitempty"`
 	JobName               *string     `json:"job_name,omitempty"`
 	LimitedAvailability   *bool       `json:"limited_availability,omitempty"`


Test patch:
diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go
index bc4ff4e2..5be1c304 100644
--- a/github/github-accessors_test.go
+++ b/github/github-accessors_test.go
@@ -826,7 +826,7 @@ func TestAuditEntry_GetHeadSHA(tt *testing.T) {
 }
 
 func TestAuditEntry_GetHookID(tt *testing.T) {
-	var zeroValue string
+	var zeroValue int64
 	a := &AuditEntry{HookID: &zeroValue}
 	a.GetHookID()
 	a = &AuditEntry{}