Skip to content

Commit 64a09b4

Browse files
authored
Merge branch 'master' into rupok/change-pointer-params-to-values
2 parents 793450f + 17f7ee4 commit 64a09b4

40 files changed

Lines changed: 1284 additions & 108 deletions

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ linters:
2929
enabled-checks:
3030
- commentedOutCode
3131
- commentFormatting
32+
- paramTypeCombine
3233
goheader:
3334
values:
3435
regexp:

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ file.
8585
[REVIEWERS][] takes a look by mentioning them in a PR comment.
8686

8787
[forking]: https://help.github.com/articles/fork-a-repo
88-
[well-formed commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
88+
[well-formed commit messages]: https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
8989
[pull request]: https://help.github.com/articles/creating-a-pull-request
9090
[monitored by codecov.io]: https://codecov.io/gh/google/go-github
9191
[REVIEWERS]: ./REVIEWERS

example/codespaces/newreposecretwithxcrypto/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func getSecretValue(secretName string) (string, error) {
122122
//
123123
// Finally, the github.EncodedSecret is passed into the GitHub client.Codespaces.CreateOrUpdateRepoSecret method to
124124
// populate the secret in the GitHub repo.
125-
func addRepoSecret(ctx context.Context, client *github.Client, owner string, repo, secretName string, secretValue string) error {
125+
func addRepoSecret(ctx context.Context, client *github.Client, owner, repo, secretName, secretValue string) error {
126126
publicKey, _, err := client.Codespaces.GetRepoPublicKey(ctx, owner, repo)
127127
if err != nil {
128128
return err
@@ -140,7 +140,7 @@ func addRepoSecret(ctx context.Context, client *github.Client, owner string, rep
140140
return nil
141141
}
142142

143-
func encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName string, secretValue string) (*github.EncryptedSecret, error) {
143+
func encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName, secretValue string) (*github.EncryptedSecret, error) {
144144
decodedPublicKey, err := base64.StdEncoding.DecodeString(publicKey.GetKey())
145145
if err != nil {
146146
return nil, fmt.Errorf("unable to decode public key: %v", err)

example/codespaces/newusersecretwithxcrypto/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func addUserSecret(ctx context.Context, client *github.Client, secretName, secre
147147
return nil
148148
}
149149

150-
func encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName string, secretValue string) (*github.EncryptedSecret, error) {
150+
func encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName, secretValue string) (*github.EncryptedSecret, error) {
151151
decodedPublicKey, err := base64.StdEncoding.DecodeString(publicKey.GetKey())
152152
if err != nil {
153153
return nil, fmt.Errorf("base64.StdEncoding.DecodeString was unable to decode public key: %v", err)

example/newreposecretwithlibsodium/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func getSecretValue(secretName string) (string, error) {
118118
//
119119
// Finally, the github.EncodedSecret is passed into the GitHub client.Actions.CreateOrUpdateRepoSecret method to
120120
// populate the secret in the GitHub repo.
121-
func addRepoSecret(ctx context.Context, client *github.Client, owner string, repo, secretName string, secretValue string) error {
121+
func addRepoSecret(ctx context.Context, client *github.Client, owner, repo, secretName, secretValue string) error {
122122
publicKey, _, err := client.Actions.GetRepoPublicKey(ctx, owner, repo)
123123
if err != nil {
124124
return err
@@ -136,7 +136,7 @@ func addRepoSecret(ctx context.Context, client *github.Client, owner string, rep
136136
return nil
137137
}
138138

139-
func encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName string, secretValue string) (*github.EncryptedSecret, error) {
139+
func encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName, secretValue string) (*github.EncryptedSecret, error) {
140140
decodedPublicKey, err := base64.StdEncoding.DecodeString(publicKey.GetKey())
141141
if err != nil {
142142
return nil, fmt.Errorf("base64.StdEncoding.DecodeString was unable to decode public key: %v", err)

example/newreposecretwithxcrypto/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func getSecretValue(secretName string) (string, error) {
122122
//
123123
// Finally, the github.EncodedSecret is passed into the GitHub client.Actions.CreateOrUpdateRepoSecret method to
124124
// populate the secret in the GitHub repo.
125-
func addRepoSecret(ctx context.Context, client *github.Client, owner string, repo, secretName string, secretValue string) error {
125+
func addRepoSecret(ctx context.Context, client *github.Client, owner, repo, secretName, secretValue string) error {
126126
publicKey, _, err := client.Actions.GetRepoPublicKey(ctx, owner, repo)
127127
if err != nil {
128128
return err
@@ -140,7 +140,7 @@ func addRepoSecret(ctx context.Context, client *github.Client, owner string, rep
140140
return nil
141141
}
142142

143-
func encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName string, secretValue string) (*github.EncryptedSecret, error) {
143+
func encryptSecretWithPublicKey(publicKey *github.PublicKey, secretName, secretValue string) (*github.EncryptedSecret, error) {
144144
decodedPublicKey, err := base64.StdEncoding.DecodeString(publicKey.GetKey())
145145
if err != nil {
146146
return nil, fmt.Errorf("base64.StdEncoding.DecodeString was unable to decode public key: %v", err)

github/actions_artifacts_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ func TestActionsService_DownloadArtifact_StatusMovedPermanently_followRedirects(
456456
})
457457
mux.HandleFunc("/redirect", func(w http.ResponseWriter, r *http.Request) {
458458
testMethod(t, r, "GET")
459-
http.Redirect(w, r, "http://github.com/artifact", http.StatusFound)
459+
http.Redirect(w, r, "https://github.com/artifact", http.StatusFound)
460460
})
461461

462462
ctx := context.Background()
@@ -467,7 +467,7 @@ func TestActionsService_DownloadArtifact_StatusMovedPermanently_followRedirects(
467467
if resp.StatusCode != http.StatusFound {
468468
t.Errorf("Actions.DownloadArtifact return status %d, want %d", resp.StatusCode, http.StatusFound)
469469
}
470-
want := "http://github.com/artifact"
470+
want := "https://github.com/artifact"
471471
if url.String() != want {
472472
t.Errorf("Actions.DownloadArtifact returned %+v, want %+v", url.String(), want)
473473
}

github/actions_workflow_jobs_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ func TestActionsService_GetWorkflowJobLogs(t *testing.T) {
207207

208208
mux.HandleFunc("/repos/o/r/actions/jobs/399444496/logs", func(w http.ResponseWriter, r *http.Request) {
209209
testMethod(t, r, "GET")
210-
http.Redirect(w, r, "http://github.com/a", http.StatusFound)
210+
http.Redirect(w, r, "https://github.com/a", http.StatusFound)
211211
})
212212

213213
ctx := context.Background()
@@ -218,7 +218,7 @@ func TestActionsService_GetWorkflowJobLogs(t *testing.T) {
218218
if resp.StatusCode != http.StatusFound {
219219
t.Errorf("Actions.GetWorkflowJobLogs returned status: %d, want %d", resp.StatusCode, http.StatusFound)
220220
}
221-
want := "http://github.com/a"
221+
want := "https://github.com/a"
222222
if url.String() != want {
223223
t.Errorf("Actions.GetWorkflowJobLogs returned %+v, want %+v", url.String(), want)
224224
}
@@ -267,7 +267,7 @@ func TestActionsService_GetWorkflowJobLogs_StatusMovedPermanently_dontFollowRedi
267267

268268
mux.HandleFunc("/repos/o/r/actions/jobs/399444496/logs", func(w http.ResponseWriter, r *http.Request) {
269269
testMethod(t, r, "GET")
270-
http.Redirect(w, r, "http://github.com/a", http.StatusMovedPermanently)
270+
http.Redirect(w, r, "https://github.com/a", http.StatusMovedPermanently)
271271
})
272272

273273
ctx := context.Background()
@@ -310,7 +310,7 @@ func TestActionsService_GetWorkflowJobLogs_StatusMovedPermanently_followRedirect
310310

311311
mux.HandleFunc("/redirect", func(w http.ResponseWriter, r *http.Request) {
312312
testMethod(t, r, "GET")
313-
http.Redirect(w, r, "http://github.com/a", http.StatusFound)
313+
http.Redirect(w, r, "https://github.com/a", http.StatusFound)
314314
})
315315

316316
ctx := context.Background()
@@ -323,7 +323,7 @@ func TestActionsService_GetWorkflowJobLogs_StatusMovedPermanently_followRedirect
323323
t.Errorf("Actions.GetWorkflowJobLogs returned status: %d, want %d", resp.StatusCode, http.StatusFound)
324324
}
325325

326-
want := "http://github.com/a"
326+
want := "https://github.com/a"
327327
if url.String() != want {
328328
t.Errorf("Actions.GetWorkflowJobLogs returned %+v, want %+v", url.String(), want)
329329
}

github/actions_workflow_runs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ func (s *ActionsService) GetWorkflowRunAttempt(ctx context.Context, owner, repo
259259
// GitHub API docs: https://docs.github.com/rest/actions/workflow-runs#download-workflow-run-attempt-logs
260260
//
261261
//meta:operation GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt_number}/logs
262-
func (s *ActionsService) GetWorkflowRunAttemptLogs(ctx context.Context, owner, repo string, runID int64, attemptNumber int, maxRedirects int) (*url.URL, *Response, error) {
262+
func (s *ActionsService) GetWorkflowRunAttemptLogs(ctx context.Context, owner, repo string, runID int64, attemptNumber, maxRedirects int) (*url.URL, *Response, error) {
263263
u := fmt.Sprintf("repos/%v/%v/actions/runs/%v/attempts/%v/logs", owner, repo, runID, attemptNumber)
264264

265265
if s.client.RateLimitRedirectionalEndpoints {

github/actions_workflow_runs_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ func TestActionsService_GetWorkflowRunAttemptLogs(t *testing.T) {
213213

214214
mux.HandleFunc("/repos/o/r/actions/runs/399444496/attempts/2/logs", func(w http.ResponseWriter, r *http.Request) {
215215
testMethod(t, r, "GET")
216-
http.Redirect(w, r, "http://github.com/a", http.StatusFound)
216+
http.Redirect(w, r, "https://github.com/a", http.StatusFound)
217217
})
218218

219219
ctx := context.Background()
@@ -224,7 +224,7 @@ func TestActionsService_GetWorkflowRunAttemptLogs(t *testing.T) {
224224
if resp.StatusCode != http.StatusFound {
225225
t.Errorf("Actions.GetWorkflowRunAttemptLogs returned status: %d, want %d", resp.StatusCode, http.StatusFound)
226226
}
227-
want := "http://github.com/a"
227+
want := "https://github.com/a"
228228
if url.String() != want {
229229
t.Errorf("Actions.GetWorkflowRunAttemptLogs returned %+v, want %+v", url.String(), want)
230230
}
@@ -262,7 +262,7 @@ func TestActionsService_GetWorkflowRunAttemptLogs_StatusMovedPermanently_dontFol
262262

263263
mux.HandleFunc("/repos/o/r/actions/runs/399444496/attempts/2/logs", func(w http.ResponseWriter, r *http.Request) {
264264
testMethod(t, r, "GET")
265-
http.Redirect(w, r, "http://github.com/a", http.StatusMovedPermanently)
265+
http.Redirect(w, r, "https://github.com/a", http.StatusMovedPermanently)
266266
})
267267

268268
ctx := context.Background()
@@ -305,7 +305,7 @@ func TestActionsService_GetWorkflowRunAttemptLogs_StatusMovedPermanently_followR
305305

306306
mux.HandleFunc("/redirect", func(w http.ResponseWriter, r *http.Request) {
307307
testMethod(t, r, "GET")
308-
http.Redirect(w, r, "http://github.com/a", http.StatusFound)
308+
http.Redirect(w, r, "https://github.com/a", http.StatusFound)
309309
})
310310

311311
ctx := context.Background()
@@ -318,7 +318,7 @@ func TestActionsService_GetWorkflowRunAttemptLogs_StatusMovedPermanently_followR
318318
t.Errorf("Actions.GetWorkflowRunAttemptLogs returned status: %d, want %d", resp.StatusCode, http.StatusFound)
319319
}
320320

321-
want := "http://github.com/a"
321+
want := "https://github.com/a"
322322
if url.String() != want {
323323
t.Errorf("Actions.GetWorkflowRunAttemptLogs returned %+v, want %+v", url.String(), want)
324324
}
@@ -524,7 +524,7 @@ func TestActionsService_GetWorkflowRunLogs(t *testing.T) {
524524

525525
mux.HandleFunc("/repos/o/r/actions/runs/399444496/logs", func(w http.ResponseWriter, r *http.Request) {
526526
testMethod(t, r, "GET")
527-
http.Redirect(w, r, "http://github.com/a", http.StatusFound)
527+
http.Redirect(w, r, "https://github.com/a", http.StatusFound)
528528
})
529529

530530
ctx := context.Background()
@@ -535,7 +535,7 @@ func TestActionsService_GetWorkflowRunLogs(t *testing.T) {
535535
if resp.StatusCode != http.StatusFound {
536536
t.Errorf("Actions.GetWorkflowRunLogs returned status: %d, want %d", resp.StatusCode, http.StatusFound)
537537
}
538-
want := "http://github.com/a"
538+
want := "https://github.com/a"
539539
if url.String() != want {
540540
t.Errorf("Actions.GetWorkflowRunLogs returned %+v, want %+v", url.String(), want)
541541
}
@@ -573,7 +573,7 @@ func TestActionsService_GetWorkflowRunLogs_StatusMovedPermanently_dontFollowRedi
573573

574574
mux.HandleFunc("/repos/o/r/actions/runs/399444496/logs", func(w http.ResponseWriter, r *http.Request) {
575575
testMethod(t, r, "GET")
576-
http.Redirect(w, r, "http://github.com/a", http.StatusMovedPermanently)
576+
http.Redirect(w, r, "https://github.com/a", http.StatusMovedPermanently)
577577
})
578578

579579
ctx := context.Background()
@@ -616,7 +616,7 @@ func TestActionsService_GetWorkflowRunLogs_StatusMovedPermanently_followRedirect
616616

617617
mux.HandleFunc("/redirect", func(w http.ResponseWriter, r *http.Request) {
618618
testMethod(t, r, "GET")
619-
http.Redirect(w, r, "http://github.com/a", http.StatusFound)
619+
http.Redirect(w, r, "https://github.com/a", http.StatusFound)
620620
})
621621

622622
ctx := context.Background()
@@ -629,7 +629,7 @@ func TestActionsService_GetWorkflowRunLogs_StatusMovedPermanently_followRedirect
629629
t.Errorf("Actions.GetWorkflowJobLogs returned status: %d, want %d", resp.StatusCode, http.StatusFound)
630630
}
631631

632-
want := "http://github.com/a"
632+
want := "https://github.com/a"
633633
if url.String() != want {
634634
t.Errorf("Actions.GetWorkflowJobLogs returned %+v, want %+v", url.String(), want)
635635
}

0 commit comments

Comments
 (0)