Skip to content

Commit 1dd8a76

Browse files
committed
fix(telegram): fix link bot to release tag
1 parent 65e0688 commit 1dd8a76

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

services/webhook/general.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ func getPullRequestPayloadInfo(p *api.PullRequestPayload, linkFormatter linkForm
141141

142142
func getReleasePayloadInfo(p *api.ReleasePayload, linkFormatter linkFormatter, withSender bool) (text string, color int) {
143143
repoLink := linkFormatter(p.Repository.HTMLURL, p.Repository.FullName)
144-
refLink := linkFormatter(p.Repository.HTMLURL+"/src/"+util.PathEscapeSegments(p.Release.TagName), p.Release.TagName)
144+
refLink := linkFormatter(p.Repository.HTMLURL+"/releases/tag/"+util.PathEscapeSegments(p.Release.TagName), p.Release.TagName)
145145

146146
switch p.Action {
147147
case api.HookReleasePublished:

services/webhook/telegram_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ func TestTelegramPayload(t *testing.T) {
154154
require.NotNil(t, pl)
155155
require.IsType(t, &TelegramPayload{}, pl)
156156

157-
assert.Equal(t, `[<a href="http://localhost:3000/test/repo">test/repo</a>] Release created: <a href="http://localhost:3000/test/repo/src/v1.0">v1.0</a> by <a href="https://try.gitea.io/user1">user1</a>`, pl.(*TelegramPayload).Message)
157+
assert.Equal(t, `[<a href="http://localhost:3000/test/repo">test/repo</a>] Release created: <a href="http://localhost:3000/test/repo/releases/tag/v1.0">v1.0</a> by <a href="https://try.gitea.io/user1">user1</a>`, pl.(*TelegramPayload).Message)
158158
})
159159
}
160160

0 commit comments

Comments
 (0)