mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-06-06 09:28:51 +00:00
add link for pr and for commit
This commit is contained in:
parent
943fafb67e
commit
f5721a9383
1 changed files with 4 additions and 0 deletions
|
@ -288,6 +288,7 @@ func (g *GitHub) push(r *http.Request) (*common.Hook, error) {
|
||||||
commit := &common.Commit{}
|
commit := &common.Commit{}
|
||||||
commit.Sha = hook.Head.ID
|
commit.Sha = hook.Head.ID
|
||||||
commit.Ref = hook.Ref
|
commit.Ref = hook.Ref
|
||||||
|
commit.Link = hook.Head.URL
|
||||||
commit.Branch = strings.Replace(commit.Ref, "refs/heads/", "", -1)
|
commit.Branch = strings.Replace(commit.Ref, "refs/heads/", "", -1)
|
||||||
commit.Message = hook.Head.Message
|
commit.Message = hook.Head.Message
|
||||||
commit.Timestamp = hook.Head.Timestamp
|
commit.Timestamp = hook.Head.Timestamp
|
||||||
|
@ -366,6 +367,7 @@ func (g *GitHub) pullRequest(r *http.Request) (*common.Hook, error) {
|
||||||
c.Remote = *hook.PullRequest.Head.Repo.CloneURL
|
c.Remote = *hook.PullRequest.Head.Repo.CloneURL
|
||||||
c.Author = &common.Author{}
|
c.Author = &common.Author{}
|
||||||
c.Author.Login = *hook.PullRequest.Head.User.Login
|
c.Author.Login = *hook.PullRequest.Head.User.Login
|
||||||
|
|
||||||
// Author.Email
|
// Author.Email
|
||||||
// Message
|
// Message
|
||||||
|
|
||||||
|
@ -376,6 +378,7 @@ func (g *GitHub) pullRequest(r *http.Request) (*common.Hook, error) {
|
||||||
pr.Base.Sha = *hook.PullRequest.Base.SHA
|
pr.Base.Sha = *hook.PullRequest.Base.SHA
|
||||||
pr.Base.Ref = *hook.PullRequest.Base.Ref
|
pr.Base.Ref = *hook.PullRequest.Base.Ref
|
||||||
pr.Base.Remote = *hook.PullRequest.Base.Repo.CloneURL
|
pr.Base.Remote = *hook.PullRequest.Base.Repo.CloneURL
|
||||||
|
pr.Link = *hook.PullRequest.HTMLURL
|
||||||
// Branch
|
// Branch
|
||||||
// Message
|
// Message
|
||||||
// Timestamp
|
// Timestamp
|
||||||
|
@ -391,6 +394,7 @@ type pushHook struct {
|
||||||
|
|
||||||
Head struct {
|
Head struct {
|
||||||
ID string `json:"id"`
|
ID string `json:"id"`
|
||||||
|
URL string `json:"url"`
|
||||||
Message string `json:"message"`
|
Message string `json:"message"`
|
||||||
Timestamp string `json:"timestamp"`
|
Timestamp string `json:"timestamp"`
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue