Skip to content

Commit 16026ee

Browse files
Merge pull request #37 from marcotuna/master
Support SHA of Git Tag from Gogs Webhook
2 parents 2a5de62 + 747f0a1 commit 16026ee

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

scm/driver/gogs/testdata/webhooks/tag_create.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"ref": "v1.0.0",
33
"ref_type": "tag",
4+
"sha": "599d25c67b05717269f50ac082b34f176d085179",
45
"default_branch": "master",
56
"repository": {
67
"id": 61,

scm/driver/gogs/testdata/webhooks/tag_create.json.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"Ref": {
33
"Name": "v1.0.0",
4-
"Sha": ""
4+
"Sha": "599d25c67b05717269f50ac082b34f176d085179"
55
},
66
"Repo": {
77
"ID": "61",

scm/driver/gogs/webhook.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ type (
145145
createHook struct {
146146
Ref string `json:"ref"`
147147
RefType string `json:"ref_type"`
148+
Sha string `json:"sha"`
148149
DefaultBranch string `json:"default_branch"`
149150
Repository repository `json:"repository"`
150151
Sender user `json:"sender"`
@@ -178,6 +179,7 @@ func convertTagHook(dst *createHook, action scm.Action) *scm.TagHook {
178179
Action: action,
179180
Ref: scm.Reference{
180181
Name: dst.Ref,
182+
Sha: dst.Sha,
181183
},
182184
Repo: *convertRepository(&dst.Repository),
183185
Sender: *convertUser(&dst.Sender),

0 commit comments

Comments
 (0)