- This is built into Cobra the argument parser. Now `ghcs --version`
exists.
- When we prepare to bump the version, we need to remember to update
this value else the Homebrew formula, GitHub releases and the `ghcs
--version` output will be mismatched.
- Fixes https://github.com/github/ghcs/issues/16.
- I have my GitHub API token in my environment as
`HOMEBREW_GITHUB_API_TOKEN`, so with things that need `GITHUB_TOKEN` I
have to remember to `export GITHUB_TOKEN=$HOMEBREW_GITHUB_API_TOKEN`.
- I didn't for this tool, and got this unfriendly error message:
```
❯ ghcs list
Error: error getting user: Bad credentials
Usage:
ghcs list [flags]
Flags:
-h, --help help for list
error getting user: Bad credentials
```
- This moves the "do you have a `GITHUB_TOKEN`" question to the very
beginning (no guarantees about org SSO access, just a string that
exists), erroring out with a nice message if users don't have that
envvar set:
```
issyl0 in cetus in ~/repos/github/ghcs/cmd/ghcs on gracefully-fail-if-token-envvar-unset
❯ ./ghcs list
The GITHUB_TOKEN environment variable is required. Create a Personal Access Token with org SSO access at https://github.com/settings/tokens/new.
issyl0 in cetus in ~/repos/github/ghcs/cmd/ghcs on gracefully-fail-if-token-envvar-unset
❯ export GITHUB_TOKEN=$HOMEBREW_GITHUB_API_TOKEN
❯ ./ghcs list
+--------------------------------+--------------------+------------------------------------+----------+---------------------------+
| NAME | REPOSITORY | BRANCH | STATE | CREATED AT |
+--------------------------------+--------------------+------------------------------------+----------+---------------------------+
| issyl0-github-cat-ggrpj5fvwvr | github/cat | dependabot/bundler/graphql-1.12.13 | Shutdown | 2021-07-13T12:36:53+01:00 |
+--------------------------------+--------------------+------------------------------------+----------+---------------------------+
```
The first paragraph uses single quotes when referring to shell arguments
and variables, but the rest of the docs use double quotes. This commit
switches to using single quotes throughout the docs.
I prefer to use single quotes inside string literals because Go uses
double quotes to define a string literal.
On non-Unix-like shells like Windows Command Prompt, single quotes are
handled differently. You need to define aliases using double quotes
instead of single quotes.
I added an inline example to illustrate the quotes. The example is
formatted as inline code blocks in Markdown. Unfortunately, because Go
uses backticks for raw string literals, I needed to do some rather ugly
string concatenation in order to get the backticks included in the doc
string.
This also rearranges the notes so that the platform specific notes are
at the end of the documentation.
Flag for signaling that a discussion should be created with the given
category for the release. Discussions are not supported for draft
releases. If a discussion category is given for a draft, an err will be
shown.
Closes#3381
This enforces strict separation between serialization structs used for
repository creation payload with respect to whether GraphQL or REST was
used. Before, a field added to a GraphQL payload would leak to REST
payload (and vice versa).
we don't ever check the return of Fprintf anywhere else in the codebase
so doing it here suggests that it's a special case. if it's something we
should be doing we can circle back and do it more consistently.
Upgrades gojq, the library that powers the `--jq` filter flag for JSON.
This upgrade is purely housekeeping and not to address any particular
issue reported with gh.
https://github.com/itchyny/gojq/releases/tag/v0.12.4
If `gh run watch ${ID} --exit-status` is run and "ID" is the ID of a
completed job that failed, return a SilentError. This ensures that the
program returns a non-zero code.
Fixes#3962