From 599d25c67b05717269f50ac082b34f176d085179 Mon Sep 17 00:00:00 2001 From: Matti Ranta Date: Thu, 18 Apr 2019 14:11:17 -0400 Subject: [PATCH 1/2] get sha of tag in gitea --- scm/driver/gitea/webhook.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scm/driver/gitea/webhook.go b/scm/driver/gitea/webhook.go index 21519197e..f346559a9 100644 --- a/scm/driver/gitea/webhook.go +++ b/scm/driver/gitea/webhook.go @@ -139,6 +139,7 @@ type ( createHook struct { Ref string `json:"ref"` RefType string `json:"ref_type"` + Sha string `json:"sha"` DefaultBranch string `json:"default_branch"` Repository repository `json:"repository"` Sender user `json:"sender"` @@ -172,6 +173,7 @@ func convertTagHook(dst *createHook, action scm.Action) *scm.TagHook { Action: action, Ref: scm.Reference{ Name: dst.Ref, + Sha: dst.Sha, }, Repo: *convertRepository(&dst.Repository), Sender: *convertUser(&dst.Sender), From 92d3f5eb247e887147353c7ab978123adf16558f Mon Sep 17 00:00:00 2001 From: Matti Ranta Date: Thu, 18 Apr 2019 14:13:26 -0400 Subject: [PATCH 2/2] update json for testing --- scm/driver/gitea/testdata/webhooks/tag_create.json | 1 + scm/driver/gitea/testdata/webhooks/tag_create.json.golden | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/scm/driver/gitea/testdata/webhooks/tag_create.json b/scm/driver/gitea/testdata/webhooks/tag_create.json index 4319f23a8..4f05b531c 100644 --- a/scm/driver/gitea/testdata/webhooks/tag_create.json +++ b/scm/driver/gitea/testdata/webhooks/tag_create.json @@ -1,6 +1,7 @@ { "ref": "v1.0.0", "ref_type": "tag", + "sha": "599d25c67b05717269f50ac082b34f176d085179", "default_branch": "master", "repository": { "id": 61, diff --git a/scm/driver/gitea/testdata/webhooks/tag_create.json.golden b/scm/driver/gitea/testdata/webhooks/tag_create.json.golden index 9445f09e8..9aba91aee 100644 --- a/scm/driver/gitea/testdata/webhooks/tag_create.json.golden +++ b/scm/driver/gitea/testdata/webhooks/tag_create.json.golden @@ -1,7 +1,7 @@ { "Ref": { "Name": "v1.0.0", - "Sha": "" + "Sha": "599d25c67b05717269f50ac082b34f176d085179" }, "Repo": { "ID": "61",