From bed51947792a4736f964f02756616e8f50fafbf7 Mon Sep 17 00:00:00 2001 From: David Wolf Date: Wed, 5 May 2021 09:28:43 -0400 Subject: [PATCH 1/3] add download token and sha to ListRunnerApplicationDownloads --- github/actions_runners.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/github/actions_runners.go b/github/actions_runners.go index 66d9c309e65..92fe4fe0049 100644 --- a/github/actions_runners.go +++ b/github/actions_runners.go @@ -12,10 +12,12 @@ import ( // RunnerApplicationDownload represents a binary for the self-hosted runner application that can be downloaded. type RunnerApplicationDownload struct { - OS *string `json:"os,omitempty"` - Architecture *string `json:"architecture,omitempty"` - DownloadURL *string `json:"download_url,omitempty"` - Filename *string `json:"filename,omitempty"` + OS *string `json:"os,omitempty"` + Architecture *string `json:"architecture,omitempty"` + DownloadURL *string `json:"download_url,omitempty"` + Filename *string `json:"filename,omitempty"` + TempDownloadToken *string `json:"temp_download_token,omitempty"` + Sha256Checksum *string `json:"sha256_checksum,omitempty"` } // ActionsEnabledOnOrgRepos represents all the repositories in an organization for which Actions is enabled. From c7dfc2f6f95632b0ed2a96f4868825bca0e9550a Mon Sep 17 00:00:00 2001 From: David Wolf Date: Wed, 5 May 2021 09:40:56 -0400 Subject: [PATCH 2/3] change Sha to SHA --- github/actions_runners.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/actions_runners.go b/github/actions_runners.go index 92fe4fe0049..5bdebb3193f 100644 --- a/github/actions_runners.go +++ b/github/actions_runners.go @@ -17,7 +17,7 @@ type RunnerApplicationDownload struct { DownloadURL *string `json:"download_url,omitempty"` Filename *string `json:"filename,omitempty"` TempDownloadToken *string `json:"temp_download_token,omitempty"` - Sha256Checksum *string `json:"sha256_checksum,omitempty"` + SHA256Checksum *string `json:"sha256_checksum,omitempty"` } // ActionsEnabledOnOrgRepos represents all the repositories in an organization for which Actions is enabled. From 554c4644afcd43fa5989b0017075a8be225d65f1 Mon Sep 17 00:00:00 2001 From: David Wolf Date: Wed, 5 May 2021 09:42:09 -0400 Subject: [PATCH 3/3] generate accessors --- github/github-accessors.go | 16 ++++++++++++++++ github/github-accessors_test.go | 20 ++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/github/github-accessors.go b/github/github-accessors.go index d39473a0f24..37ddb180d8f 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -13612,6 +13612,22 @@ func (r *RunnerApplicationDownload) GetOS() string { return *r.OS } +// GetSHA256Checksum returns the SHA256Checksum field if it's non-nil, zero value otherwise. +func (r *RunnerApplicationDownload) GetSHA256Checksum() string { + if r == nil || r.SHA256Checksum == nil { + return "" + } + return *r.SHA256Checksum +} + +// GetTempDownloadToken returns the TempDownloadToken field if it's non-nil, zero value otherwise. +func (r *RunnerApplicationDownload) GetTempDownloadToken() string { + if r == nil || r.TempDownloadToken == nil { + return "" + } + return *r.TempDownloadToken +} + // GetAllowsPublicRepositories returns the AllowsPublicRepositories field if it's non-nil, zero value otherwise. func (r *RunnerGroup) GetAllowsPublicRepositories() bool { if r == nil || r.AllowsPublicRepositories == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index b3d31306ed5..3da8dda1037 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -15939,6 +15939,26 @@ func TestRunnerApplicationDownload_GetOS(tt *testing.T) { r.GetOS() } +func TestRunnerApplicationDownload_GetSHA256Checksum(tt *testing.T) { + var zeroValue string + r := &RunnerApplicationDownload{SHA256Checksum: &zeroValue} + r.GetSHA256Checksum() + r = &RunnerApplicationDownload{} + r.GetSHA256Checksum() + r = nil + r.GetSHA256Checksum() +} + +func TestRunnerApplicationDownload_GetTempDownloadToken(tt *testing.T) { + var zeroValue string + r := &RunnerApplicationDownload{TempDownloadToken: &zeroValue} + r.GetTempDownloadToken() + r = &RunnerApplicationDownload{} + r.GetTempDownloadToken() + r = nil + r.GetTempDownloadToken() +} + func TestRunnerGroup_GetAllowsPublicRepositories(tt *testing.T) { var zeroValue bool r := &RunnerGroup{AllowsPublicRepositories: &zeroValue}