diff --git a/cmd/version.go b/cmd/version.go index eeeaad3..52e8596 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -5,6 +5,7 @@ package cmd import ( "fmt" + "os" "github.com/spf13/cobra" @@ -21,12 +22,15 @@ var versionCmd = &cobra.Command{ Long: `All software has versions. This is crs-toolchain's`, Run: func(cmd *cobra.Command, args []string) { fmt.Println("crs-toolchain", rootCmd.Version) - latest, err := updater.LatestVersion() - if err != nil { - logger.Error().Err(err).Msg("Failed to check for updates") - } else if latest != "" { - fmt.Println("Latest version is:", latest) - fmt.Println("Run 'crs-toolchain self-update' to update") + // do not run when in CI (e.g. GitHub Actions) + if os.Getenv("CI") != "true" { + latest, err := updater.LatestVersion() + if err != nil { + logger.Error().Err(err).Msg("Failed to check for updates") + } else if latest != "" { + fmt.Println("Latest version is:", latest) + fmt.Println("Run 'crs-toolchain self-update' to update") + } } }, }