diff --git a/README.md b/README.md index c8aae9cefa5..a52280cae47 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ GitHub CLI is available for repositories hosted on GitHub.com and GitHub Enterpr ## Contributing -If anything feels off, or if you feel that some functionality is missing, please check out the [contributing page][contributing]. We'd love to hear your feedback! +If anything feels off, or if you feel that some functionality is missing, please check out the [contributing page][contributing]. @@ -20,25 +20,25 @@ If anything feels off, or if you feel that some functionality is missing, please ### macOS -`gh` is available via [Homebrew][] and [MacPorts][]. +`gh` is available via [Homebrew][], [MacPorts][], and as a downloadable binary from the [releases page][]. #### Homebrew -|Install:|Upgrade:| -|---|---| -|`brew install gh`|`brew upgrade gh`| +| Install: | Upgrade: | +| ----------------- | ----------------- | +| `brew install gh` | `brew upgrade gh` | #### MacPorts -|Install:|Upgrade:| -|---|---| -|`sudo port install gh`|`sudo port selfupdate && sudo port upgrade gh`| - - +| Install: | Upgrade: | +| ---------------------- | ---------------------------------------------- | +| `sudo port install gh` | `sudo port selfupdate && sudo port upgrade gh` | ### Linux -See [Linux installation docs](./docs/install_linux.md). +`gh` is available via [Homebrew](#homebrew), and as downloadable binaries from the [releases page][]. + +For more information and distro-specific instructions, see the [Linux installation docs](./docs/install_linux.md). ### Windows @@ -61,10 +61,9 @@ scoop update gh #### Chocolatey -|Install:|Upgrade:| -|---|---| -|`choco install gh`|`choco upgrade gh`| - +| Install: | Upgrade: | +| ------------------ | ------------------ | +| `choco install gh` | `choco upgrade gh` | #### Signed MSI diff --git a/api/queries_issue.go b/api/queries_issue.go index 6ef431ed422..d607901a31f 100644 --- a/api/queries_issue.go +++ b/api/queries_issue.go @@ -23,7 +23,6 @@ type IssuesAndTotalCount struct { TotalCount int } -// Ref. https://developer.github.com/v4/object/issue/ type Issue struct { ID string Number int diff --git a/cmd/gh/main.go b/cmd/gh/main.go index db329c3cdb6..242df7ed2e4 100644 --- a/cmd/gh/main.go +++ b/cmd/gh/main.go @@ -186,7 +186,17 @@ func printError(out io.Writer, err error, cmd *cobra.Command, debug bool) { } func shouldCheckForUpdate() bool { - return updaterEnabled != "" && !isCompletionCommand() && utils.IsTerminal(os.Stderr) + if os.Getenv("GH_NO_UPDATE_NOTIFIER") != "" { + return false + } + return updaterEnabled != "" && !isCI() && !isCompletionCommand() && utils.IsTerminal(os.Stderr) +} + +// based on https://github.com/watson/ci-info/blob/HEAD/index.js +func isCI() bool { + return os.Getenv("CI") != "" || // GitHub Actions, Travis CI, CircleCI, Cirrus CI, GitLab CI, AppVeyor, CodeShip, dsari + os.Getenv("BUILD_NUMBER") != "" || // Jenkins, TeamCity + os.Getenv("RUN_ID") != "" // TaskCluster, dsari } func isCompletionCommand() bool { diff --git a/pkg/cmd/pr/view/view.go b/pkg/cmd/pr/view/view.go index 33a75b34dac..4476a84c0de 100644 --- a/pkg/cmd/pr/view/view.go +++ b/pkg/cmd/pr/view/view.go @@ -191,7 +191,6 @@ func printHumanPrPreview(io *iostreams.IOStreams, pr *api.PullRequest) error { return nil } -// Ref. https://developer.github.com/v4/enum/pullrequestreviewstate/ const ( requestedReviewState = "REQUESTED" // This is our own state for review request approvedReviewState = "APPROVED" @@ -250,7 +249,6 @@ func prReviewerList(pr api.PullRequest) string { return reviewerList } -// Ref. https://developer.github.com/v4/union/requestedreviewer/ const teamTypeName = "Team" const ghostName = "ghost" diff --git a/pkg/cmd/root/help_topic.go b/pkg/cmd/root/help_topic.go index bd23bc68a42..d88109ad3d9 100644 --- a/pkg/cmd/root/help_topic.go +++ b/pkg/cmd/root/help_topic.go @@ -39,6 +39,10 @@ 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 any value to disable update notifications. By default, gh + checks for new releases once every 24 hours and displays an upgrade notice on standard + error if a newer version was found. `) cmd := &cobra.Command{