From 2a2ff0550c12bb59ea6b44a93cf742f120bb0d31 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sat, 4 Nov 2017 23:06:37 +0800 Subject: [PATCH] fix missing commit sha and wrong tag link. Signed-off-by: Bo-Yi Wu --- remote/gitea/helper.go | 4 ++-- remote/gitea/types.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/remote/gitea/helper.go b/remote/gitea/helper.go index d625dc040..587daf383 100644 --- a/remote/gitea/helper.go +++ b/remote/gitea/helper.go @@ -100,9 +100,9 @@ func buildFromTag(hook *pushHook) *model.Build { return &model.Build{ Event: model.EventTag, - Commit: hook.After, + Commit: hook.Sha, 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), Message: fmt.Sprintf("created tag %s", hook.Ref), Avatar: avatar, diff --git a/remote/gitea/types.go b/remote/gitea/types.go index f648f8de1..1671bd812 100644 --- a/remote/gitea/types.go +++ b/remote/gitea/types.go @@ -1,6 +1,7 @@ package gitea type pushHook struct { + Sha string `json:"sha"` Ref string `json:"ref"` Before string `json:"before"` After string `json:"after"`