Skip to content

Commit 8b7c770

Browse files
Merge pull request #22 from techknowlogick/gitea-sha-tag
get sha of tag in gitea
2 parents b318186 + 92d3f5e commit 8b7c770

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

scm/driver/gitea/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/gitea/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/gitea/webhook.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ type (
139139
createHook struct {
140140
Ref string `json:"ref"`
141141
RefType string `json:"ref_type"`
142+
Sha string `json:"sha"`
142143
DefaultBranch string `json:"default_branch"`
143144
Repository repository `json:"repository"`
144145
Sender user `json:"sender"`
@@ -172,6 +173,7 @@ func convertTagHook(dst *createHook, action scm.Action) *scm.TagHook {
172173
Action: action,
173174
Ref: scm.Reference{
174175
Name: dst.Ref,
176+
Sha: dst.Sha,
175177
},
176178
Repo: *convertRepository(&dst.Repository),
177179
Sender: *convertUser(&dst.Sender),

0 commit comments

Comments
 (0)