From 7c908116ac06a45d7493d5e888dec7b0c1d936fe Mon Sep 17 00:00:00 2001 From: Alistair Israel Date: Thu, 28 Mar 2024 14:35:03 -0400 Subject: [PATCH] Show visibility --- pkg/cmd/secrets.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/cmd/secrets.go b/pkg/cmd/secrets.go index 342fa8c2..3a04d166 100644 --- a/pkg/cmd/secrets.go +++ b/pkg/cmd/secrets.go @@ -237,6 +237,7 @@ func setSecrets(cmd *cobra.Command, args []string) { canPromptUser := !utils.GetBoolFlag(cmd, "no-interactive") localConfig := configuration.LocalConfig(cmd) visibility := cmd.Flag("visibility").Value.String() + visibilityModified := visibility != "" utils.RequireValue("token", localConfig.Token.Value) @@ -314,7 +315,7 @@ func setSecrets(cmd *cobra.Command, args []string) { Name: key, Value: &value, } - if visibility != "" { + if visibilityModified { changeRequest.Visibility = &visibility } changeRequests = append(changeRequests, changeRequest) @@ -327,7 +328,7 @@ func setSecrets(cmd *cobra.Command, args []string) { Name: key, Value: &value, } - if visibility != "" { + if visibilityModified { changeRequest.Visibility = &visibility } changeRequests = append(changeRequests, changeRequest) @@ -347,7 +348,7 @@ func setSecrets(cmd *cobra.Command, args []string) { } else { changeRequest.Value = &secretArr[1] } - if visibility != "" { + if visibilityModified { changeRequest.Visibility = &visibility } changeRequests = append(changeRequests, changeRequest) @@ -360,7 +361,7 @@ func setSecrets(cmd *cobra.Command, args []string) { } if !utils.Silent { - printer.Secrets(response, keys, jsonFlag, false, raw, false, false) + printer.Secrets(response, keys, jsonFlag, false, raw, false, visibilityModified) } }