mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-12 11:36:29 +00:00
Merge pull request #155 from fudanchii/pr-author
Set PR commit author from User.Login
This commit is contained in:
commit
07965b356f
2 changed files with 2 additions and 1 deletions
|
@ -107,7 +107,7 @@ func (r *Repo) Commands() []string {
|
||||||
case len(r.PR) > 0:
|
case len(r.PR) > 0:
|
||||||
|
|
||||||
cmds = append(cmds, fmt.Sprintf("git fetch origin +refs/pull/%s/head:refs/remotes/origin/pr/%s", r.PR, r.PR))
|
cmds = append(cmds, fmt.Sprintf("git fetch origin +refs/pull/%s/head:refs/remotes/origin/pr/%s", r.PR, r.PR))
|
||||||
cmds = append(cmds, fmt.Sprintf("git checkout -qf pr/%s", r.PR))
|
cmds = append(cmds, fmt.Sprintf("git checkout -qf -b pr/%s origin/pr/%s", r.PR, r.PR))
|
||||||
//cmds = append(cmds, fmt.Sprintf("git fetch origin +refs/pull/%s/merge:", r.PR))
|
//cmds = append(cmds, fmt.Sprintf("git fetch origin +refs/pull/%s/merge:", r.PR))
|
||||||
//cmds = append(cmds, fmt.Sprintf("git checkout -qf %s", "FETCH_HEAD"))
|
//cmds = append(cmds, fmt.Sprintf("git checkout -qf %s", "FETCH_HEAD"))
|
||||||
// if a specific commit is provided then we'll
|
// if a specific commit is provided then we'll
|
||||||
|
|
|
@ -230,6 +230,7 @@ func (h *HookHandler) PullRequestHook(w http.ResponseWriter, r *http.Request) {
|
||||||
commit.Status = "Pending"
|
commit.Status = "Pending"
|
||||||
commit.Created = time.Now().UTC()
|
commit.Created = time.Now().UTC()
|
||||||
commit.Gravatar = hook.PullRequest.User.GravatarId
|
commit.Gravatar = hook.PullRequest.User.GravatarId
|
||||||
|
commit.Author = hook.PullRequest.User.Login
|
||||||
commit.PullRequest = strconv.Itoa(hook.Number)
|
commit.PullRequest = strconv.Itoa(hook.Number)
|
||||||
commit.Message = hook.PullRequest.Title
|
commit.Message = hook.PullRequest.Title
|
||||||
// label := p.PullRequest.Head.Labe
|
// label := p.PullRequest.Head.Labe
|
||||||
|
|
Loading…
Reference in a new issue