mirror of
https://github.com/go-gitea/gitea
synced 2025-07-03 09:07:19 +00:00
Included tag search capabilities (#32045)
Resolves #31998 The first screenshot shows the tag page without any filter being applied:  The second one, shows the page when the given filter returns no tag:  The last one shows a single tag being filtered:  Signed-off-by: Bruno Sofiato <bruno.sofiato@gmail.com>
This commit is contained in:
@ -234,6 +234,7 @@ type FindReleasesOptions struct {
|
||||
IsDraft optional.Option[bool]
|
||||
TagNames []string
|
||||
HasSha1 optional.Option[bool] // useful to find draft releases which are created with existing tags
|
||||
NamePattern optional.Option[string]
|
||||
}
|
||||
|
||||
func (opts FindReleasesOptions) ToConds() builder.Cond {
|
||||
@ -261,6 +262,11 @@ func (opts FindReleasesOptions) ToConds() builder.Cond {
|
||||
cond = cond.And(builder.Eq{"sha1": ""})
|
||||
}
|
||||
}
|
||||
|
||||
if opts.NamePattern.Has() && opts.NamePattern.Value() != "" {
|
||||
cond = cond.And(builder.Like{"lower_tag_name", strings.ToLower(opts.NamePattern.Value())})
|
||||
}
|
||||
|
||||
return cond
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user