From 14f1b370c1b5513f8b36768a8eda0b773d5f1e14 Mon Sep 17 00:00:00 2001 From: Ahmad Nurus S Date: Sat, 24 Jun 2023 02:05:34 +0700 Subject: [PATCH 1/2] provide full response for generate-jitconfig method --- github/actions_runners.go | 1 + github/github-accessors.go | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/github/actions_runners.go b/github/actions_runners.go index 3990a5a90f..7427451ccf 100644 --- a/github/actions_runners.go +++ b/github/actions_runners.go @@ -58,6 +58,7 @@ type GenerateJITConfigRequest struct { // JITRunnerConfig represents encoded JIT configuration that can be used to bootstrap a self-hosted runner. type JITRunnerConfig struct { + Runner *Runner `json:"runner,omitempty"` EncodedJITConfig *string `json:"encoded_jit_config,omitempty"` } diff --git a/github/github-accessors.go b/github/github-accessors.go index 8acb72b042..14d0343928 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -9398,6 +9398,14 @@ func (i *IssueStats) GetTotalIssues() int { return *i.TotalIssues } +// GetRunner returns the Runner field. +func (j *JITRunnerConfig) GetRunner() *Runner { + if j == nil || j.Runner == nil { + return nil + } + return j.Runner +} + // GetEncodedJITConfig returns the EncodedJITConfig field if it's non-nil, zero value otherwise. func (j *JITRunnerConfig) GetEncodedJITConfig() string { if j == nil || j.EncodedJITConfig == nil { From dafc163ed163d1a73e03749fa3e2f580b83c77fc Mon Sep 17 00:00:00 2001 From: Ahmad Nurus S Date: Sat, 24 Jun 2023 02:25:11 +0700 Subject: [PATCH 2/2] run go generate --- github/github-accessors.go | 16 ++++++++-------- github/github-accessors_test.go | 7 +++++++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/github/github-accessors.go b/github/github-accessors.go index 14d0343928..01b5796fec 100644 --- a/github/github-accessors.go +++ b/github/github-accessors.go @@ -9398,14 +9398,6 @@ func (i *IssueStats) GetTotalIssues() int { return *i.TotalIssues } -// GetRunner returns the Runner field. -func (j *JITRunnerConfig) GetRunner() *Runner { - if j == nil || j.Runner == nil { - return nil - } - return j.Runner -} - // GetEncodedJITConfig returns the EncodedJITConfig field if it's non-nil, zero value otherwise. func (j *JITRunnerConfig) GetEncodedJITConfig() string { if j == nil || j.EncodedJITConfig == nil { @@ -9414,6 +9406,14 @@ func (j *JITRunnerConfig) GetEncodedJITConfig() string { return *j.EncodedJITConfig } +// GetRunner returns the Runner field. +func (j *JITRunnerConfig) GetRunner() *Runner { + if j == nil { + return nil + } + return j.Runner +} + // GetTotalCount returns the TotalCount field if it's non-nil, zero value otherwise. func (j *Jobs) GetTotalCount() int { if j == nil || j.TotalCount == nil { diff --git a/github/github-accessors_test.go b/github/github-accessors_test.go index 3f39d9c1a9..959edc4deb 100644 --- a/github/github-accessors_test.go +++ b/github/github-accessors_test.go @@ -11029,6 +11029,13 @@ func TestJITRunnerConfig_GetEncodedJITConfig(tt *testing.T) { j.GetEncodedJITConfig() } +func TestJITRunnerConfig_GetRunner(tt *testing.T) { + j := &JITRunnerConfig{} + j.GetRunner() + j = nil + j.GetRunner() +} + func TestJobs_GetTotalCount(tt *testing.T) { var zeroValue int j := &Jobs{TotalCount: &zeroValue}