Skip to content

Commit 36bd5d7

Browse files
lunny6543
andauthored
Fix feed push tag (#14064)
* Fix dashboard feed bug when push tag * Fix variable name * Fix delete tag Co-authored-by: 6543 <[email protected]>
1 parent e674478 commit 36bd5d7

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

‎models/action.go‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,11 @@ func (a *Action) GetBranch() string {
242242
return strings.TrimPrefix(a.RefName, git.BranchPrefix)
243243
}
244244

245+
// GetTag returns the action's repository tag.
246+
func (a *Action) GetTag() string {
247+
return strings.TrimPrefix(a.RefName, git.TagPrefix)
248+
}
249+
245250
// GetContent returns the action's content.
246251
func (a *Action) GetContent() string {
247252
return a.Content

‎templates/user/dashboard/feeds.tmpl‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
{{else if eq .GetOpType 8}}
2929
{{$.i18n.Tr "action.transfer_repo" .GetContent .GetRepoLink .ShortRepoPath | Str2html}}
3030
{{else if eq .GetOpType 9}}
31-
{{ $branchLink := .GetBranch | EscapePound | Escape}}
32-
{{$.i18n.Tr "action.push_tag" .GetRepoLink $branchLink .ShortRepoPath | Str2html}}
31+
{{ $tagLink := .GetTag | EscapePound | Escape}}
32+
{{$.i18n.Tr "action.push_tag" .GetRepoLink $tagLink .ShortRepoPath | Str2html}}
3333
{{else if eq .GetOpType 10}}
3434
{{ $index := index .GetIssueInfos 0}}
3535
{{$.i18n.Tr "action.comment_issue" .GetRepoLink $index .ShortRepoPath | Str2html}}
@@ -50,7 +50,7 @@
5050
{{$.i18n.Tr "action.reopen_pull_request" .GetRepoLink $index .ShortRepoPath | Str2html}}
5151
{{else if eq .GetOpType 16}}
5252
{{ $index := index .GetIssueInfos 0}}
53-
{{$.i18n.Tr "action.delete_tag" .GetRepoLink (.GetBranch|Escape) .ShortRepoPath | Str2html}}
53+
{{$.i18n.Tr "action.delete_tag" .GetRepoLink (.GetTag|Escape) .ShortRepoPath | Str2html}}
5454
{{else if eq .GetOpType 17}}
5555
{{ $index := index .GetIssueInfos 0}}
5656
{{$.i18n.Tr "action.delete_branch" .GetRepoLink (.GetBranch|Escape) .ShortRepoPath | Str2html}}

0 commit comments

Comments
 (0)