Skip to content

Commit 8d3f6c6

Browse files
committed
fix: Expect at least one artifact in verification
Fixes slsa-framework#425 introduces by slsa-framework#419 Signed-off-by: Mihai Maruseac <[email protected]>
1 parent e20f3cc commit 8d3f6c6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cli/slsa-verifier/verify.go

+6
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ func verifyArtifactCmd() *cobra.Command {
3333

3434
cmd := &cobra.Command{
3535
Use: "verify-artifact [flags] artifact [artifact..]",
36+
Args: func(cmd *cobra.Command, args []string) error {
37+
if len(args) < 1 {
38+
return errors.New("expects at least one artifact")
39+
}
40+
return nil
41+
},
3642
Short: "Verifies SLSA provenance on artifact blobs given as arguments (assuming same provenance)",
3743
RunE: func(cmd *cobra.Command, args []string) error {
3844
v := verify.VerifyArtifactCommand{

0 commit comments

Comments
 (0)