mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-04-26 13:34:45 +00:00
Show error if secret name is missing (#4014)
This commit is contained in:
parent
c0b1d6aaa4
commit
107564f54c
1 changed files with 6 additions and 0 deletions
|
@ -16,6 +16,7 @@ package secret
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
"html/template"
|
"html/template"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
@ -51,6 +52,11 @@ func secretInfo(ctx context.Context, c *cli.Command) error {
|
||||||
secretName = c.String("name")
|
secretName = c.String("name")
|
||||||
format = c.String("format") + "\n"
|
format = c.String("format") + "\n"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if secretName == "" {
|
||||||
|
return fmt.Errorf("secret name is missing")
|
||||||
|
}
|
||||||
|
|
||||||
client, err := internal.NewClient(ctx, c)
|
client, err := internal.NewClient(ctx, c)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue