mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-06-15 16:57:13 +02:00
Remove plugin-only option from secrets (#2213)
This commit is contained in:
@@ -46,17 +46,13 @@ var secretCreateCmd = &cli.Command{
|
||||
Usage: "secret value",
|
||||
},
|
||||
&cli.StringSliceFlag{
|
||||
Name: "event",
|
||||
Name: "events",
|
||||
Usage: "secret limited to these events",
|
||||
},
|
||||
&cli.StringSliceFlag{
|
||||
Name: "image",
|
||||
Name: "images",
|
||||
Usage: "secret limited to these images",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "plugins-only",
|
||||
Usage: "secret limited to plugins",
|
||||
},
|
||||
),
|
||||
}
|
||||
|
||||
@@ -67,11 +63,10 @@ func secretCreate(c *cli.Context) error {
|
||||
}
|
||||
|
||||
secret := &woodpecker.Secret{
|
||||
Name: strings.ToLower(c.String("name")),
|
||||
Value: c.String("value"),
|
||||
Images: c.StringSlice("image"),
|
||||
PluginsOnly: c.Bool("plugins-only"),
|
||||
Events: c.StringSlice("event"),
|
||||
Name: strings.ToLower(c.String("name")),
|
||||
Value: c.String("value"),
|
||||
Images: c.StringSlice("images"),
|
||||
Events: c.StringSlice("events"),
|
||||
}
|
||||
if len(secret.Events) == 0 {
|
||||
secret.Events = defaultSecretEvents
|
||||
|
||||
@@ -46,17 +46,13 @@ var secretUpdateCmd = &cli.Command{
|
||||
Usage: "secret value",
|
||||
},
|
||||
&cli.StringSliceFlag{
|
||||
Name: "event",
|
||||
Name: "events",
|
||||
Usage: "secret limited to these events",
|
||||
},
|
||||
&cli.StringSliceFlag{
|
||||
Name: "image",
|
||||
Name: "images",
|
||||
Usage: "secret limited to these images",
|
||||
},
|
||||
&cli.BoolFlag{
|
||||
Name: "plugins-only",
|
||||
Usage: "secret limited to plugins",
|
||||
},
|
||||
),
|
||||
}
|
||||
|
||||
@@ -67,11 +63,10 @@ func secretUpdate(c *cli.Context) error {
|
||||
}
|
||||
|
||||
secret := &woodpecker.Secret{
|
||||
Name: strings.ToLower(c.String("name")),
|
||||
Value: c.String("value"),
|
||||
Images: c.StringSlice("image"),
|
||||
PluginsOnly: c.Bool("plugins-only"),
|
||||
Events: c.StringSlice("event"),
|
||||
Name: strings.ToLower(c.String("name")),
|
||||
Value: c.String("value"),
|
||||
Images: c.StringSlice("images"),
|
||||
Events: c.StringSlice("events"),
|
||||
}
|
||||
if strings.HasPrefix(secret.Value, "@") {
|
||||
path := strings.TrimPrefix(secret.Value, "@")
|
||||
|
||||
Reference in New Issue
Block a user