Commit graph

21 commits

Author SHA1 Message Date
Issy Long
810c127608 goreleaser: Fix version string replacement
- The `Version` variable casing changed in 6a4950cf7a (diff-d897a31624bae4fe935e8dc2243f41626c68639be6643535297c06935277ffb4), so we need to update our version setting code.
- Otherwise, for `ghcs 0.11.0`, `ghcs --version` would print "DEV".
2021-09-10 16:17:37 +01:00
Alan Donovan
2cbe120774 return err, don"t fatal 2021-09-09 16:39:41 -04:00
Alan Donovan
ecb6c8a09a Merge branch 'main' into lightstep 2021-09-09 09:07:02 -04:00
Alan Donovan
c6a9915861 add --lightstep flag for tracing 2021-09-08 17:27:34 -04:00
Alan Donovan
3a46f2ac56 add --lightstep flag for tracing 2021-09-08 17:15:42 -04:00
Alan Donovan
d395dae3a8 don't double-print errors 2021-09-06 15:17:24 -04:00
Alan Donovan
6a527941bf suppress display of usage message after errors 2021-08-31 16:35:28 -04:00
Alan Donovan
da34d12abb respond to review 2021-08-27 15:26:34 -04:00
Alan Donovan
38ff786a7d cmd/ghcs: style tweaks 2021-08-27 12:03:20 -04:00
Mislav Marohnić
97d8285b58 Do not require GITHUB_TOKEN for merely viewing command help 2021-08-16 23:19:20 +02:00
Mislav Marohnić
3931c16bd7 Provide version number at build time 2021-07-26 17:07:42 +02:00
CamiloGarciaLaRotta
7e49db3be3 config: bump to 0.7.1
Hoping to prove that Goreleaser & Homebrew run automatically
2021-07-22 10:33:00 -04:00
Camilo Garcia La Rotta
14468baba6 config: bump to v0.7.0 2021-07-22 10:13:20 -04:00
Issy Long
69865fa762 cmd/ghcs/main: Better description of ghcs as a whole
Co-authored-by: Camilo Garcia La Rotta <camilogarcialarotta@github.com>
2021-07-22 14:08:20 +01:00
Jose Garcia
345e3e1b8a Update main.go 2021-07-21 13:50:19 -04:00
Kristján Oddsson
7a3e47ff3e Update error message link and wording. 2021-07-21 12:46:44 +01:00
Jose Garcia
8faee1e5a9 Update main.go 2021-07-20 08:09:48 -04:00
Issy Long
2f8d00e0f8 Merge pull request #19 from github/version-cmd
cmd/ghcs/main: Add `--version` flag
2021-07-20 13:02:41 +01:00
Issy Long
4582fed1cc cmd/ghcs/main: Add --version flag
- 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.
2021-07-19 18:45:18 +01:00
Issy Long
cb29b11ab2 cmd/ghcs/main: Fail gracefully if GITHUB_TOKEN entirely unset
- 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 |
+--------------------------------+--------------------+------------------------------------+----------+---------------------------+
```
2021-07-19 18:10:15 +01:00
Jose Garcia
4a0eaa3da5 Latest and greatest 2021-07-14 16:12:30 -04:00