mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-25 01:40:30 +00:00
25 lines
435 B
Go
25 lines
435 B
Go
package main
|
|
|
|
import "github.com/urfave/cli"
|
|
|
|
var globalSecretListCmd = cli.Command{
|
|
Name: "ls",
|
|
Usage: "list all secrets",
|
|
Action: globalSecretList,
|
|
Flags: secretListFlags(),
|
|
}
|
|
|
|
func globalSecretList(c *cli.Context) error {
|
|
client, err := newClient(c)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
secrets, err := client.GlobalSecretList()
|
|
|
|
if err != nil || len(secrets) == 0 {
|
|
return err
|
|
}
|
|
|
|
return secretDisplayList(secrets, c)
|
|
}
|