19bc6279738fa88b2605c3948c835b649ac93c75

Author
Ayman Bagabas <ayman.bagabas@gmail.com>
Committer
Ayman Bagabas <ayman.bagabas@gmail.com>
Date

Message

fix(ssh): add argument validation to webhook deliveries commands

Diff

 1diff --git a/pkg/ssh/cmd/webhooks.go b/pkg/ssh/cmd/webhooks.go
 2index 5f156672651d74d356ee5297d15c5679d034674e..6312b909baac7c31fd246683dba33284226778d9 100644
 3--- a/pkg/ssh/cmd/webhooks.go
 4+++ b/pkg/ssh/cmd/webhooks.go
 5@@ -313,6 +313,7 @@ func webhookDeliveriesRedeliverCommand() *cobra.Command {
 6 	cmd := &cobra.Command{
 7 		Use:               "redeliver REPOSITORY WEBHOOK_ID DELIVERY_ID",
 8 		Short:             "Redeliver a webhook delivery",
 9+		Args:              cobra.ExactArgs(3),
10 		PersistentPreRunE: checkIfAdmin,
11 		RunE: func(cmd *cobra.Command, args []string) error {
12 			ctx := cmd.Context()
13@@ -343,6 +344,7 @@ func webhookDeliveriesGetCommand() *cobra.Command {
14 	cmd := &cobra.Command{
15 		Use:               "get REPOSITORY WEBHOOK_ID DELIVERY_ID",
16 		Short:             "Get a webhook delivery",
17+		Args:              cobra.ExactArgs(3),
18 		PersistentPreRunE: checkIfAdmin,
19 		RunE: func(cmd *cobra.Command, args []string) error {
20 			ctx := cmd.Context()