mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-29 13:21:10 +00:00
Sanitize tag ref for gitea/forgejo (#3664)
This commit is contained in:
parent
00ccec078c
commit
7f776ebf18
1 changed files with 4 additions and 3 deletions
|
@ -127,13 +127,14 @@ func pipelineFromTag(hook *pushHook) *model.Pipeline {
|
||||||
hook.Repo.HTMLURL,
|
hook.Repo.HTMLURL,
|
||||||
fixMalformedAvatar(hook.Sender.AvatarURL),
|
fixMalformedAvatar(hook.Sender.AvatarURL),
|
||||||
)
|
)
|
||||||
|
ref := strings.TrimPrefix(hook.Ref, "refs/tags/")
|
||||||
|
|
||||||
return &model.Pipeline{
|
return &model.Pipeline{
|
||||||
Event: model.EventTag,
|
Event: model.EventTag,
|
||||||
Commit: hook.Sha,
|
Commit: hook.Sha,
|
||||||
Ref: fmt.Sprintf("refs/tags/%s", hook.Ref),
|
Ref: fmt.Sprintf("refs/tags/%s", ref),
|
||||||
ForgeURL: fmt.Sprintf("%s/src/tag/%s", hook.Repo.HTMLURL, hook.Ref),
|
ForgeURL: fmt.Sprintf("%s/src/tag/%s", hook.Repo.HTMLURL, ref),
|
||||||
Message: fmt.Sprintf("created tag %s", hook.Ref),
|
Message: fmt.Sprintf("created tag %s", ref),
|
||||||
Avatar: avatar,
|
Avatar: avatar,
|
||||||
Author: hook.Sender.UserName,
|
Author: hook.Sender.UserName,
|
||||||
Sender: hook.Sender.UserName,
|
Sender: hook.Sender.UserName,
|
||||||
|
|
Loading…
Reference in a new issue