+
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ file.
[REVIEWERS][] takes a look by mentioning them in a PR comment.

[forking]: https://help.github.com/articles/fork-a-repo
[well-formed commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
[well-formed commit messages]: https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
[pull request]: https://help.github.com/articles/creating-a-pull-request
[monitored by codecov.io]: https://codecov.io/gh/google/go-github
[REVIEWERS]: ./REVIEWERS
Expand Down
4 changes: 2 additions & 2 deletions github/actions_artifacts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ func TestActionsService_DownloadArtifact_StatusMovedPermanently_followRedirects(
})
mux.HandleFunc("/redirect", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
http.Redirect(w, r, "http://github.com/artifact", http.StatusFound)
http.Redirect(w, r, "https://github.com/artifact", http.StatusFound)
})

ctx := context.Background()
Expand All @@ -467,7 +467,7 @@ func TestActionsService_DownloadArtifact_StatusMovedPermanently_followRedirects(
if resp.StatusCode != http.StatusFound {
t.Errorf("Actions.DownloadArtifact return status %d, want %d", resp.StatusCode, http.StatusFound)
}
want := "http://github.com/artifact"
want := "https://github.com/artifact"
if url.String() != want {
t.Errorf("Actions.DownloadArtifact returned %+v, want %+v", url.String(), want)
}
Expand Down
10 changes: 5 additions & 5 deletions github/actions_workflow_jobs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func TestActionsService_GetWorkflowJobLogs(t *testing.T) {

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

ctx := context.Background()
Expand All @@ -218,7 +218,7 @@ func TestActionsService_GetWorkflowJobLogs(t *testing.T) {
if resp.StatusCode != http.StatusFound {
t.Errorf("Actions.GetWorkflowJobLogs returned status: %d, want %d", resp.StatusCode, http.StatusFound)
}
want := "http://github.com/a"
want := "https://github.com/a"
if url.String() != want {
t.Errorf("Actions.GetWorkflowJobLogs returned %+v, want %+v", url.String(), want)
}
Expand Down Expand Up @@ -267,7 +267,7 @@ func TestActionsService_GetWorkflowJobLogs_StatusMovedPermanently_dontFollowRedi

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

ctx := context.Background()
Expand Down Expand Up @@ -310,7 +310,7 @@ func TestActionsService_GetWorkflowJobLogs_StatusMovedPermanently_followRedirect

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

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

want := "http://github.com/a"
want := "https://github.com/a"
if url.String() != want {
t.Errorf("Actions.GetWorkflowJobLogs returned %+v, want %+v", url.String(), want)
}
Expand Down
20 changes: 10 additions & 10 deletions github/actions_workflow_runs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func TestActionsService_GetWorkflowRunAttemptLogs(t *testing.T) {

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

ctx := context.Background()
Expand All @@ -224,7 +224,7 @@ func TestActionsService_GetWorkflowRunAttemptLogs(t *testing.T) {
if resp.StatusCode != http.StatusFound {
t.Errorf("Actions.GetWorkflowRunAttemptLogs returned status: %d, want %d", resp.StatusCode, http.StatusFound)
}
want := "http://github.com/a"
want := "https://github.com/a"
if url.String() != want {
t.Errorf("Actions.GetWorkflowRunAttemptLogs returned %+v, want %+v", url.String(), want)
}
Expand Down Expand Up @@ -262,7 +262,7 @@ func TestActionsService_GetWorkflowRunAttemptLogs_StatusMovedPermanently_dontFol

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

ctx := context.Background()
Expand Down Expand Up @@ -305,7 +305,7 @@ func TestActionsService_GetWorkflowRunAttemptLogs_StatusMovedPermanently_followR

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

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

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

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

ctx := context.Background()
Expand All @@ -535,7 +535,7 @@ func TestActionsService_GetWorkflowRunLogs(t *testing.T) {
if resp.StatusCode != http.StatusFound {
t.Errorf("Actions.GetWorkflowRunLogs returned status: %d, want %d", resp.StatusCode, http.StatusFound)
}
want := "http://github.com/a"
want := "https://github.com/a"
if url.String() != want {
t.Errorf("Actions.GetWorkflowRunLogs returned %+v, want %+v", url.String(), want)
}
Expand Down Expand Up @@ -573,7 +573,7 @@ func TestActionsService_GetWorkflowRunLogs_StatusMovedPermanently_dontFollowRedi

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

ctx := context.Background()
Expand Down Expand Up @@ -616,7 +616,7 @@ func TestActionsService_GetWorkflowRunLogs_StatusMovedPermanently_followRedirect

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

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

want := "http://github.com/a"
want := "https://github.com/a"
if url.String() != want {
t.Errorf("Actions.GetWorkflowJobLogs returned %+v, want %+v", url.String(), want)
}
Expand Down
4 changes: 2 additions & 2 deletions github/dependabot_alerts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ func TestDependabotSecurityAdvisory_Marshal(t *testing.T) {
URL: Ptr("https://www.djangoproject.com/weblog/2018/feb/01/security-releases/"),
},
{
URL: Ptr("http://www.securitytracker.com/id/1040422"),
URL: Ptr("https://www.securitytracker.com/id/1040422"),
},
},
PublishedAt: &Timestamp{publishedAt},
Expand Down Expand Up @@ -385,7 +385,7 @@ func TestDependabotSecurityAdvisory_Marshal(t *testing.T) {
"url": "https://www.djangoproject.com/weblog/2018/feb/01/security-releases/"
},
{
"url": "http://www.securitytracker.com/id/1040422"
"url": "https://www.securitytracker.com/id/1040422"
}
],
"published_at": "2018-10-03T21:13:54Z",
Expand Down
2 changes: 1 addition & 1 deletion github/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func (c *Client) Octocat(ctx context.Context, message string) (string, *Response

// Zen returns a random line from The Zen of GitHub.
//
// See also: http://warpspire.com/posts/taste/
// See also: https://warpspire.com/posts/taste/
//
// GitHub API docs: https://docs.github.com/rest/meta/meta#get-the-zen-of-github
//
Expand Down
2 changes: 1 addition & 1 deletion github/orgs_audit_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type AuditEntry struct {
HashedToken *string `json:"hashed_token,omitempty"`
Org *string `json:"org,omitempty"`
OrgID *int64 `json:"org_id,omitempty"`
Timestamp *Timestamp `json:"@timestamp,omitempty"` // The time the audit log event occurred, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time).
Timestamp *Timestamp `json:"@timestamp,omitempty"` // The time the audit log event occurred, given as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time).
TokenID *int64 `json:"token_id,omitempty"`
TokenScopes *string `json:"token_scopes,omitempty"`
User *string `json:"user,omitempty"` // The user that was affected by the action performed (if available).
Expand Down
10 changes: 5 additions & 5 deletions github/repos_contents_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ func TestRepositoriesService_GetArchiveLink(t *testing.T) {

mux.HandleFunc("/repos/o/r/tarball/yo", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
http.Redirect(w, r, "http://github.com/a", http.StatusFound)
http.Redirect(w, r, "https://github.com/a", http.StatusFound)
})
ctx := context.Background()
url, resp, err := client.Repositories.GetArchiveLink(ctx, "o", "r", Tarball, &RepositoryContentGetOptions{Ref: "yo"}, 1)
Expand All @@ -897,7 +897,7 @@ func TestRepositoriesService_GetArchiveLink(t *testing.T) {
if resp.StatusCode != http.StatusFound {
t.Errorf("Repositories.GetArchiveLink returned status: %d, want %d", resp.StatusCode, http.StatusFound)
}
want := "http://github.com/a"
want := "https://github.com/a"
if url.String() != want {
t.Errorf("Repositories.GetArchiveLink returned %+v, want %+v", url.String(), want)
}
Expand Down Expand Up @@ -944,7 +944,7 @@ func TestRepositoriesService_GetArchiveLink_StatusMovedPermanently_dontFollowRed

mux.HandleFunc("/repos/o/r/tarball", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
http.Redirect(w, r, "http://github.com/a", http.StatusMovedPermanently)
http.Redirect(w, r, "https://github.com/a", http.StatusMovedPermanently)
})
ctx := context.Background()
_, resp, _ := client.Repositories.GetArchiveLink(ctx, "o", "r", Tarball, &RepositoryContentGetOptions{}, 0)
Expand Down Expand Up @@ -985,7 +985,7 @@ func TestRepositoriesService_GetArchiveLink_StatusMovedPermanently_followRedirec
})
mux.HandleFunc("/redirect", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
http.Redirect(w, r, "http://github.com/a", http.StatusFound)
http.Redirect(w, r, "https://github.com/a", http.StatusFound)
})
ctx := context.Background()
url, resp, err := client.Repositories.GetArchiveLink(ctx, "o", "r", Tarball, &RepositoryContentGetOptions{}, 1)
Expand All @@ -995,7 +995,7 @@ func TestRepositoriesService_GetArchiveLink_StatusMovedPermanently_followRedirec
if resp.StatusCode != http.StatusFound {
t.Errorf("Repositories.GetArchiveLink returned status: %d, want %d", resp.StatusCode, http.StatusFound)
}
want := "http://github.com/a"
want := "https://github.com/a"
if url.String() != want {
t.Errorf("Repositories.GetArchiveLink returned %+v, want %+v", url.String(), want)
}
Expand Down
12 changes: 6 additions & 6 deletions github/repos_hooks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ func TestRepositoriesService_Subscribe(t *testing.T) {
testFormValues(t, r, values{
"hub.mode": "subscribe",
"hub.topic": "https://github.com/o/r/events/push",
"hub.callback": "http://postbin.org/123",
"hub.callback": "http://localhost:8080/callback",
"hub.secret": "test secret",
})
})
Expand All @@ -591,15 +591,15 @@ func TestRepositoriesService_Subscribe(t *testing.T) {
"o",
"r",
"push",
"http://postbin.org/123",
"http://localhost:8080/callback",
[]byte("test secret"),
)
if err != nil {
t.Errorf("Repositories.Subscribe returned error: %v", err)
}

testNewRequestAndDoFailure(t, "Subscribe", client, func() (*Response, error) {
return client.Repositories.Subscribe(ctx, "o", "r", "push", "http://postbin.org/123", nil)
return client.Repositories.Subscribe(ctx, "o", "r", "push", "http://localhost:8080", nil)
})
}

Expand All @@ -613,7 +613,7 @@ func TestRepositoriesService_Unsubscribe(t *testing.T) {
testFormValues(t, r, values{
"hub.mode": "unsubscribe",
"hub.topic": "https://github.com/o/r/events/push",
"hub.callback": "http://postbin.org/123",
"hub.callback": "http://localhost:8080/callback",
"hub.secret": "test secret",
})
})
Expand All @@ -624,14 +624,14 @@ func TestRepositoriesService_Unsubscribe(t *testing.T) {
"o",
"r",
"push",
"http://postbin.org/123",
"http://localhost:8080/callback",
[]byte("test secret"),
)
if err != nil {
t.Errorf("Repositories.Unsubscribe returned error: %v", err)
}

testNewRequestAndDoFailure(t, "Unsubscribe", client, func() (*Response, error) {
return client.Repositories.Unsubscribe(ctx, "o", "r", "push", "http://postbin.org/123", nil)
return client.Repositories.Unsubscribe(ctx, "o", "r", "push", "http://localhost:8080/callback", nil)
})
}
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载