Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore(action): get env var in pre run (#16877)
p0ny2bc4cc1435fa
diff --git a/action/command/root.go b/action/command/root.goindex 936cba9c7e..56d7cb0693 100644--- a/action/command/root.go+++ b/action/command/root.go@@ -26,7 +26,7 @@ func NewRootCommand(w *world.World) *cobra.Command {cmd.PersistentFlags().StringVar(&w.Output, "output", "", "Output file location. The output file is a JSON file with the created resource names")cmd.PersistentFlags().StringVar(&w.URL, "url", "https://demo.bytebase.com", "Bytebase URL")cmd.PersistentFlags().StringVar(&w.ServiceAccount, "service-account", "[email protected]", "Bytebase Service account")- cmd.PersistentFlags().StringVar(&w.ServiceAccountSecret, "service-account-secret", os.Getenv("BYTEBASE_SERVICE_ACCOUNT_SECRET"), "Bytebase Service account secret")+ cmd.PersistentFlags().StringVar(&w.ServiceAccountSecret, "service-account-secret", "", "Bytebase Service account secret")cmd.PersistentFlags().StringVar(&w.Project, "project", "projects/hr", "Bytebase project")cmd.PersistentFlags().StringSliceVar(&w.Targets, "targets", []string{"instances/test-sample-instance/databases/hr_test", "instances/prod-sample-instance/databases/hr_prod"}, "Bytebase targets")cmd.PersistentFlags().StringVar(&w.FilePattern, "file-pattern", "", "File pattern to glob migration files")@@ -39,6 +39,9 @@ func NewRootCommand(w *world.World) *cobra.Command {func rootPreRun(w *world.World) func(cmd *cobra.Command, args []string) error {return func(cmd *cobra.Command, _ []string) error {w.Logger = slog.New(slog.NewTextHandler(cmd.ErrOrStderr(), nil))+ if w.ServiceAccountSecret == "" {+ w.ServiceAccountSecret = os.Getenv("BYTEBASE_SERVICE_ACCOUNT_SECRET")+ }if w.Platform == world.UnspecifiedPlatform {w.Platform = world.GetJobPlatform()