aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authormzroot <minoga_dot@mail.ru>2024-06-14 19:56:10 +0300
committerGitHub <noreply@github.com>2024-06-14 18:56:10 +0200
commitd4e4226c3cbfa62a6adf15f4466747468eb208c7 (patch)
treed98ea2048ea29a43ef9dcf67a7b57655a6fcd369 /modules
parent4e7b067a7fdfb3e2c8dfdf87475e3938051fd400 (diff)
downloadgitea-d4e4226c3cbfa62a6adf15f4466747468eb208c7.tar.gz
gitea-d4e4226c3cbfa62a6adf15f4466747468eb208c7.zip
Add tag protection via rest api #17862 (#31295)
Add tag protection manage via rest API. --------- Co-authored-by: Alexander Kogay <kogay.a@citilink.ru> Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'modules')
-rw-r--r--modules/structs/repo_tag.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/modules/structs/repo_tag.go b/modules/structs/repo_tag.go
index 4a7d895288..5722513f4f 100644
--- a/modules/structs/repo_tag.go
+++ b/modules/structs/repo_tag.go
@@ -3,6 +3,8 @@
package structs
+import "time"
+
// Tag represents a repository tag
type Tag struct {
Name string `json:"name"`
@@ -38,3 +40,29 @@ type CreateTagOption struct {
Message string `json:"message"`
Target string `json:"target"`
}
+
+// TagProtection represents a tag protection
+type TagProtection struct {
+ ID int64 `json:"id"`
+ NamePattern string `json:"name_pattern"`
+ WhitelistUsernames []string `json:"whitelist_usernames"`
+ WhitelistTeams []string `json:"whitelist_teams"`
+ // swagger:strfmt date-time
+ Created time.Time `json:"created_at"`
+ // swagger:strfmt date-time
+ Updated time.Time `json:"updated_at"`
+}
+
+// CreateTagProtectionOption options for creating a tag protection
+type CreateTagProtectionOption struct {
+ NamePattern string `json:"name_pattern"`
+ WhitelistUsernames []string `json:"whitelist_usernames"`
+ WhitelistTeams []string `json:"whitelist_teams"`
+}
+
+// EditTagProtectionOption options for editing a tag protection
+type EditTagProtectionOption struct {
+ NamePattern *string `json:"name_pattern"`
+ WhitelistUsernames []string `json:"whitelist_usernames"`
+ WhitelistTeams []string `json:"whitelist_teams"`
+}