fix: Expect at least one artifact in verification (#426)

* fix: Expect at least one artifact in verification

Fixes #425 introduces by #419

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>

* go fmt

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>

Signed-off-by: Mihai Maruseac <mihaimaruseac@google.com>
This commit is contained in:
Mihai Maruseac
2022-12-29 13:05:10 -08:00
committed by GitHub
parent e20f3cc7a3
commit 17463c02b3

View File

@@ -32,7 +32,13 @@ func verifyArtifactCmd() *cobra.Command {
o := &verify.VerifyOptions{}
cmd := &cobra.Command{
Use: "verify-artifact [flags] artifact [artifact..]",
Use: "verify-artifact [flags] artifact [artifact..]",
Args: func(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
return errors.New("expects at least one artifact")
}
return nil
},
Short: "Verifies SLSA provenance on artifact blobs given as arguments (assuming same provenance)",
RunE: func(cmd *cobra.Command, args []string) error {
v := verify.VerifyArtifactCommand{