The "nospace" directive instructs the shell completion logic to avoid
adding a space after completing the word. However, this feature was
broken in an older Cobra, and users still saw a space character added.
In most case we want the space because we anticipate that the user might
want to add extra arguments to the command.
This status describes a state where the head branch is mergeable and
technically not blocked per base branch requirements, but it does have
non-passing checks.
Conditions prohibiting a regular merge: BLOCKED, BEHIND, DIRTY.
Conditions triggering a regular merge even if `--auto` was set: CLEAN,
HAS_HOOKS.
Note that UNKNOWN status does not trigger either of the conditions.
This removes the false equivalence between GH_CONFIG_DIR and
XDG_CONFIG_HOME. These settings do not have the same effect and should
not be used for the same purposes.
Also remove the documentation about what `XDG_*` settings do. We simply
conform to the XDG Base Directory Specification, but will not document
it. It's likely that users of these environment variables already know
what they do.
Before:
$ GH_ENTERPRISE_TOKEN="..." gh pr create
could not find hosts config: not found
Now:
$ GH_ENTERPRISE_TOKEN="..." gh pr create
set the GH_HOST environment variable to specify which GitHub host to use
Also amends `gh help environment` documentation to suggest the use of
GH_HOST when scripting operations with GitHub Enterprise repositories.
If GH_CONFIG_DIR is set, don't auto migrate the config file. This fixes
the situation where the path given via GH_CONFIG_DIR does not exist and
the cli attempts to migrate an existing config to that location.
Fixes#3837
- 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 |
+--------------------------------+--------------------+------------------------------------+----------+---------------------------+
```