Commit graph

66 commits

Author SHA1 Message Date
Babak K. Shandiz
d129b94fc5
refactor: remove returned resp from api.EndpointNeedsScopes
The returned response from `api.EndpointNeedsScopes` causes `bodyclose`
linter to raise a false positive error, assuming it's a new response that
its body needs to be closed.

Signed-off-by: Babak K. Shandiz <babakks@github.com>
2025-11-03 20:05:24 +00:00
Andy Feller
918cafc222 Deprecate ColorScheme.Gray for ColorScheme.Muted
This commit converts all of the places using ColorScheme.Gray and ColorScheme.Grayf to Muted and Mutedf.

There is a little extra tidying up with local variable names or converting code to use Mutedf format.
2025-04-06 10:18:48 -04:00
Tyler McGoffin
0bb92c5980
Separate partitioning from globbing in cmdutil/args package and consumers (#3)
* Separate partitioning from globbing in cmdutil/args package and consumers

In the previous commit, GlobPaths was overloaded, containing logic
specific to command use-cases. This commit removes that functionality from
GlobPaths and back into the commands that have the special use-cases.

To do this, I've introduced a new Partition util in cmdutil/args.go that
will separate a slice into two slices given a predicate. This functionality
is leveraged by both the special use-cases described above to separate the
command-specific syntax from the globable filepaths.

* Add test to validate that the order of '-' in gh gist create args doesn't matter
2025-03-04 07:05:23 +05:00
Azeem Sajid
db3df04068
Merge branch 'trunk' into 5099-gh-release-create-upload-expand-glob-patterns-on-windows 2025-02-27 19:20:44 +05:00
Azeem Sajid
33c30d5bd1 Inconsistent format of examples in help text 2025-02-27 16:26:25 +05:00
Azeem Sajid
f4b65b785e Add exclude callback function 2025-02-26 12:46:56 +05:00
Azeem Sajid
8ace163608 Remove slicing 2025-02-25 10:49:28 +05:00
Azeem Sajid
092eb7e962 Support globbing for all platforms 2025-02-22 12:16:42 +05:00
Tyler McGoffin
8748bb0b1a
Add testing to GlobWindowsPaths (#2) 2025-02-21 22:33:19 +05:00
Azeem Sajid
d9bfa606cc Fix gh gist create for multiple filenames and glob patterns 2025-02-11 12:56:32 +05:00
Heath Stewart
81f3526740
Fix tests 2024-08-16 10:11:52 -07:00
William Martin
1d38230675
Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02:00
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