Repository: cli/cli
File: pkg/cmd/root/extension.go (Go)

Code before:
						LatestVersion:  ext.LatestVersion(),
						Pinned:         ext.IsPinned(),
						URL:            ext.URL(),
					}
				}
			}()
		},
		RunE: func(c *cobra.Command, args []string) error {
			args = append([]string{ext.Name()}, args...)
			if _, err := em.Dispatch(args, io.In, io.Out, io.ErrOut); err != nil {
				var execError *exec.ExitError
				if errors.As(err, &execError) {
					return &ExternalCommandExitError{execError}
				}
				return fmt.Errorf("failed to run extension: %w\n", err)
			}
			return nil
		},
		// PostRun handles communicating extension release information if found
		PostRun: func(c *cobra.Command, args []string) {
			releaseInfo := <-updateMessageChan
			if releaseInfo != nil {
				stderr := io.ErrOut
				fmt.Fprintf(stderr, "\n\n%s %s → %s\n",
					ansi.Color(fmt.Sprintf("A new release of %s is available:", ext.Name()), "yellow"),
					ansi.Color(strings.TrimPrefix(releaseInfo.CurrentVersion, "v"), "cyan"),
					ansi.Color(strings.TrimPrefix(releaseInfo.LatestVersion, "v"), "cyan"))
				if releaseInfo.Pinned {
					fmt.Fprintf(stderr, "To upgrade, run: gh extension upgrade %s --force\n", ext.Name())
				} else {
					fmt.Fprintf(stderr, "To upgrade, run: gh extension upgrade %s\n", ext.Name())
				}
				fmt.Fprintf(stderr, "%s\n\n",
					ansi.Color(releaseInfo.URL, "yellow"))
			}
		},
		GroupID: "extension",
		Annotations: map[string]string{
			"skipAuthCheck": "true",
		},
		DisableFlagParsing: true,
	}
}


Review comment (suggestion):
Total outside observer here but as a user I was wondering if it would make sense to differentiate color of current and latest versions. Make current more of orange or some warmer variant and keep the cool color tone for latest version. 

Code after:
						LatestVersion:  ext.LatestVersion(),
						Pinned:         ext.IsPinned(),
						URL:            ext.URL(),
					}
				}
			}()
		},
		RunE: func(c *cobra.Command, args []string) error {
			args = append([]string{ext.Name()}, args...)
			if _, err := em.Dispatch(args, io.In, io.Out, io.ErrOut); err != nil {
				var execError *exec.ExitError
				if errors.As(err, &execError) {
					return &ExternalCommandExitError{execError}
				}
				return fmt.Errorf("failed to run extension: %w\n", err)
			}
			return nil
		},
		// PostRun handles communicating extension release information if found
		PostRun: func(c *cobra.Command, args []string) {
			select {
			case releaseInfo := <-updateMessageChan:
				if releaseInfo != nil {
					stderr := io.ErrOut
					fmt.Fprintf(stderr, "\n\n%s %s → %s\n",
						cs.Yellowf("A new release of %s is available:", ext.Name()),
						cs.Cyan(strings.TrimPrefix(releaseInfo.CurrentVersion, "v")),
						cs.Cyan(strings.TrimPrefix(releaseInfo.LatestVersion, "v")))
					if releaseInfo.Pinned {
						fmt.Fprintf(stderr, "To upgrade, run: gh extension upgrade %s --force\n", ext.Name())
					} else {
						fmt.Fprintf(stderr, "To upgrade, run: gh extension upgrade %s\n", ext.Name())
					}
					fmt.Fprintf(stderr, "%s\n\n",
						cs.Yellow(releaseInfo.URL))
				}
			case <-time.After(3 * time.Second):
				// Bail on checking for new extension update as its taking too long
			}
		},
		GroupID: "extension",
		Annotations: map[string]string{
			"skipAuthCheck": "true",
		},
		DisableFlagParsing: true,
	}
}