fix missing commit sha and wrong tag link.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2017-11-04 23:06:37 +08:00
parent 0c972d8fc5
commit 2a2ff0550c
2 changed files with 3 additions and 2 deletions

View file

@ -100,9 +100,9 @@ func buildFromTag(hook *pushHook) *model.Build {
return &model.Build{ return &model.Build{
Event: model.EventTag, Event: model.EventTag,
Commit: hook.After, Commit: hook.Sha,
Ref: fmt.Sprintf("refs/tags/%s", hook.Ref), Ref: fmt.Sprintf("refs/tags/%s", hook.Ref),
Link: fmt.Sprintf("%s/src/%s", hook.Repo.URL, hook.Ref), Link: fmt.Sprintf("%s/src/tag/%s", hook.Repo.URL, hook.Ref),
Branch: fmt.Sprintf("refs/tags/%s", hook.Ref), Branch: fmt.Sprintf("refs/tags/%s", hook.Ref),
Message: fmt.Sprintf("created tag %s", hook.Ref), Message: fmt.Sprintf("created tag %s", hook.Ref),
Avatar: avatar, Avatar: avatar,

View file

@ -1,6 +1,7 @@
package gitea package gitea
type pushHook struct { type pushHook struct {
Sha string `json:"sha"`
Ref string `json:"ref"` Ref string `json:"ref"`
Before string `json:"before"` Before string `json:"before"`
After string `json:"after"` After string `json:"after"`