Commit graph

54 commits

Author SHA1 Message Date
Zack Sloane
b6dadfa7fb test update, more consistent default value display 2024-01-08 23:23:24 -05:00
Yukai Chou
21bf1babdf Proof-reading 2023-11-17 02:04:35 +08:00
Yukai Chou
17d336e005 Wrap cli flags in backticks uniformly 2023-11-16 22:54:27 +08:00
Sean Bright
6f99fd8442
Always show created gist privacy status. (#7645) 2023-07-06 06:22:50 +00:00
Sam Coe
c9a2d85793
Cleanup config.AuthToken and config.DefaultHost methods (#7049) 2023-02-28 00:24:45 +00:00
Sam Coe
e7102f9d84
Migrate to go-gh text package (#6236) 2022-09-14 09:23:55 +04:00
Sam Coe
6a8deb1f5a
Integrate latest go-gh packages (#6084) 2022-08-18 09:04:13 +03:00
Icen
7f2bbf20cc Changed the create_test.go accordingly 2022-07-22 21:18:38 +01:00
Icen
df2b19567b Added whether the gist is public or secret. Added the colour red to public and the colour green to secret 2022-07-22 20:58:29 +01:00
Sam Coe
cacff4ad6d
Use go-gh config package (#5771) 2022-06-23 11:50:04 +00:00
ffalor
7d0a7f98e1
Add progress indicator to gist create (#5526) 2022-04-27 08:17:17 +00:00
Håvard Anda Estensen
58cb773e09
Replace ioutil with io and os (#5498) 2022-04-26 13:07:44 +02:00
Christopher Nethercott
933a91e18e
Add "new" alias to "create" commands (#5388)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-04-11 16:48:34 +02:00
Josh Gross
f43574bfe0
Correctly handle Windows paths when creating gists 2022-02-06 23:21:20 +00:00
Alan Donovan
f4491c7a80 Add FlagErrorf; encapsulate FlagError.error 2021-10-21 11:40:20 -04:00
Mislav Marohnić
2ca18e0600 Warn about missing OAuth scopes when reporting HTTP 4xx errors
If a 4xx server response lists scopes in the X-Accepted-Oauth-Scopes
header that are not present in the X-Oauth-Scopes header, the final
error messaging on stderr will now include a hint for the user that they
might need to request the additional scope:

    $ gh codespace list
    error getting codespaces: HTTP 403: Must have admin rights to Repository. (https://api.github.com/user/codespaces?per_page=30)
    This API operation needs the "codespace" scope. To request it, run:  gh auth refresh -h github.com -s codespace
2021-10-13 23:24:14 +02:00
Reto Hablützel
f6e9734f17 add more hints to docs 2021-09-25 08:38:26 +02:00
Mislav Marohnić
11fbb60ae7 Rename the module to "github.com/cli/cli/v2" 2021-08-25 12:41:30 +02:00
Jon Lorusso
22235c2f97
Update documentation for gist create command to reflect default of secret. 2021-06-21 11:25:49 -04:00
Mislav Marohnić
70a9621928 💅 cleanup in gist create 2021-05-07 14:15:27 +02:00
Gowtham Munukutla
cc94dc762d shift gist validation to server rather than client 2021-05-07 14:12:00 +02:00
Mislav Marohnić
44ae7ae3cf
Merge pull request #3279 from cli/browser-refactor
Pass web browser to each individual command
2021-03-30 16:54:59 +02:00
Sam
9ec1e21d4c
Default to GHES host if only GHES is authenticated (#3286) 2021-03-30 16:51:00 +02:00
Mislav Marohnić
111e8dbcf2 Pass web browser to each individual command
This removes sensitivity to the BROWSER environment variable in tests
and makes it easier to verify the URL that the browser was invoked with
without having to stub sub-processes.
2021-03-19 21:22:37 +01:00
Mislav Marohnić
77d9051d0e Simplify looking up binary types in gist 2021-03-02 14:53:10 +01:00
Gowtham Munukutla
973fbb0925 Disallow operating on binary files in gist 2021-03-02 14:52:44 +01:00
Mislav Marohnić
f46bab256c Rename to SuccessIconWithColor 2021-01-25 14:56:39 +01:00
Mislav Marohnić
96fa6e7830 Merge remote-tracking branch 'origin' into success-icon-consistency 2021-01-22 23:56:54 +01:00
Mislav Marohnić
23d68705bc Match color of the success icon with the end state of the record 2021-01-22 23:55:33 +01:00
Mislav Marohnić
c63acf6728 Migrate to new cmd stubber in misc. tests 2021-01-18 22:42:01 +01:00
vilmibm
5309a2089a implement gh secret create and gh secret list 2020-12-04 16:47:23 -08:00
vilmibm
00617216b8 fix missing import 2020-11-16 14:03:52 -08:00
Christopher Oswald
0bb44c9ced
Support for --web when using gist create (#2263)
* Support for --web when using gist create

Proposal to close #2071

I have not worked with Go prior to this so please smite me down with the
wisdom of a million Golang gods if I'm doing something terribly wrong.

I also added a test to gist/create for the added web arg.

Pretty much referenced the implementation from pr/create.

* Fix for Tests / build (windows-latest)

I believe this fixes it as it stopped failing on a local vm. Otherwise I
will try and tackle it tomorrow.

* minor cleanup

Co-authored-by: vilmibm <vilmibm@github.com>
2020-11-16 16:01:30 -06:00
vilmibm
46a1598c19 favor SuccessIcon 2020-11-02 11:13:28 -08:00
vilmibm
a2aa154794 port entirely to ColorScheme 2020-10-29 12:37:45 -07:00
Cristian Dominguez
b71e6494ab Update gist create tests 2020-09-28 02:37:41 -03:00
Cristian Dominguez
ef8f61c61d Refactor gist create 2020-09-28 02:36:01 -03:00
vilmibm
b6502deb24 allow naming stdin gist files 2020-09-14 10:33:29 -05:00
Mislav Marohnić
d8c5b7bfc0
Merge pull request #1517 from cli/select-host
Allow explicitly setting hostname for gh operations
2020-08-14 19:08:13 +02:00
Mislav Marohnić
85f0f3aad7 Enable repo create for GHE 2020-08-14 19:02:17 +02:00
Brandon Wilson
0d60798ca4
Gist Create - Output Filename (#1498) 2020-08-13 13:38:49 +02:00
Mislav Marohnić
c095a4bead Allow explicitly specifying the hostname for gh operations
Accept the "HOST/OWNER/REPO" syntax or passing a full URL for both the
`--repo` flag and the GH_REPO environment variable and allow setting
GH_HOST environment variable to override just the hostname for
operations that assume "github.com" by default.

Examples:

    $ gh repo clone example.org/owner/repo
    $ GH_HOST=example.org gh repo clone repo

    $ GH_HOST=example.org gh api user
    $ GH_HOST=example.org gh gist create myfile.txt

    $ gh issue list -R example.org/owner/repo
    $ gh issue list -R https://example.org/owner/repo.git
    $ GH_REPO=example.org/owner/repo gh issue list
2020-08-12 16:16:34 +02:00
Mislav Marohnić
0cbcf8a7fa Merge remote-tracking branch 'origin' into ghe-api 2020-07-27 16:30:20 +02:00
Mislav Marohnić
288d01318b Respect the hostname of current repository in queries 2020-07-23 22:31:08 +02:00
vilmibm
7b8d226e0f remove redundant statement 2020-07-22 15:54:11 -05:00
vilmibm
a27c8a9c21 isolate repo view cmd 2020-07-22 15:54:11 -05:00
vilmibm
05419e46f0 put gist fixture file into gist package 2020-07-22 10:36:12 -05:00
Mislav Marohnić
16739c3044 Whoops, gist create stderr is not empty 2020-07-22 14:59:35 +02:00
Mislav Marohnić
b195075644 Tweak approach to iostreams in tests
- avoid typecast to `*bytes.Buffer`
- assert that stderr is empty
2020-07-22 14:50:23 +02:00
vilmibm
496ed477c5 linter appeasement 2020-07-21 17:47:44 -05:00