diff --git a/cmd/gh/main.go b/cmd/gh/main.go index 5fc4c2385..b4ed862fd 100644 --- a/cmd/gh/main.go +++ b/cmd/gh/main.go @@ -187,7 +187,7 @@ func printError(out io.Writer, err error, cmd *cobra.Command, debug bool) { func shouldCheckForUpdate() bool { isCIEnvironment := (os.Getenv("CI") != "") || (os.Getenv("BUILD_NUMBER") != "") || (os.Getenv("RUN_ID") != "") - isGlobalDisabled := os.Getenv("GH_NO_UPDATE_NOTIFIER") == "disabled" + isGlobalDisabled := os.Getenv("GH_NO_UPDATE_NOTIFIER") != "" return updaterEnabled != "" && !isCompletionCommand() && utils.IsTerminal(os.Stderr) && !isCIEnvironment && !isGlobalDisabled } diff --git a/pkg/cmd/root/help_topic.go b/pkg/cmd/root/help_topic.go index bd23bc68a..02218a818 100644 --- a/pkg/cmd/root/help_topic.go +++ b/pkg/cmd/root/help_topic.go @@ -39,6 +39,8 @@ func NewHelpTopic(topic string) *cobra.Command { CLICOLOR_FORCE: set to a value other than "0" to keep ANSI colors in output even when the output is piped. + + GH_NO_UPDATE_NOTIFIER: set to "1" to disable checking for updates. `) cmd := &cobra.Command{