Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get sha of tag in gitea #22

Merged
merged 2 commits into from
Apr 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scm/driver/gitea/testdata/webhooks/tag_create.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"ref": "v1.0.0",
"ref_type": "tag",
"sha": "599d25c67b05717269f50ac082b34f176d085179",
"default_branch": "master",
"repository": {
"id": 61,
Expand Down
2 changes: 1 addition & 1 deletion scm/driver/gitea/testdata/webhooks/tag_create.json.golden
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Ref": {
"Name": "v1.0.0",
"Sha": ""
"Sha": "599d25c67b05717269f50ac082b34f176d085179"
},
"Repo": {
"ID": "61",
Expand Down
2 changes: 2 additions & 0 deletions scm/driver/gitea/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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),
Expand Down