Commit graph

3730 commits

Author SHA1 Message Date
Nate Smith
640a089e55
Merge pull request #3850 from chemotaxis/fix-actions-help
Print help even if logged out
2021-06-22 14:24:06 -07:00
Nate Smith
654336fe64
Merge pull request #3871 from jonlorusso/trunk
Update documentation for gist create command with default of secret
2021-06-22 14:20:02 -07:00
Sam
68f2e77c9f
Merge pull request #3877 from autopp/complete-state-flag
Add shell completion for the `--state` flag
2021-06-22 11:49:01 -07:00
Sam Coe
1302b71fa7
linter 2021-06-22 11:41:22 -07:00
Sam Coe
e0468dbb29
whitespace 2021-06-22 11:39:47 -07:00
Sam Coe
665f552def
Small reordering 2021-06-22 11:37:56 -07:00
Jon Lorusso
22235c2f97
Update documentation for gist create command to reflect default of secret. 2021-06-21 11:25:49 -04:00
autopp
0179651dc3
Add shell completion for the --state flag 2021-06-20 20:03:21 +09:00
chemotaxis
b0f58d0cf0 Disable authentication check, but keep runnable
In this branch, we originally avoided the authentication check by
getting rid of the run method attached to the command.  Instead of that,
this commit makes the `gh actions` command runnable again, but the
authentication is disabled with `cmdutil.DisableAuthCheck`; this mirrors
what's done for `gh version`.

`gh actions` and `gh actions [-h | --help]` all work while being logged
out.

In addition, this commit restores some original behavior.  Before this
commit, the help footer (usage, inherited flags, etc.) is appended
whether you use `gh actions` or `gh actions --help`.  This commit
restores the original behavior where `gh actions` prints just the text
for the actions explanation, but `gh actions --help` appends the help
footer.
2021-06-18 23:43:42 -04:00
chemotaxis
1c103e20ac Always try to render bold font
It looks like a similar check is done in ColorScheme.Bold() where it
checks whether the scheme is enabled or not.
2021-06-18 23:07:31 -04:00
Nate Smith
936d6e1a8f
Merge pull request #3856 from cli/isolate-config-in-tests
Ensure that tests for command factory never read from user's config
2021-06-18 14:03:02 -07:00
Vishesh Gupta
4d20aa7873
Merge pull request #3801 from Vishesh-Gupta/automate-winget-release
Automate packaging for Winget
2021-06-18 15:56:58 +02:00
Mislav Marohnić
052d6588ea Revert "Whitespace"
Trailing whitespace is significant in Markdown.

This reverts commit 682c15d52c.
2021-06-18 15:16:48 +02:00
chemotaxis
89ce78e48b Restore help footer
At the moment, the "help footer" doesn't add any new information, but if
additional flags are added later, they should appear in the footer. This
change restores this help footer:

```shell
USAGE
  gh actions [flags]

INHERITED FLAGS
  --help   Show help for command

LEARN MORE
  Use 'gh <command> <subcommand> --help' for more information about a command.
  Read the manual at https://cli.github.com/manual
```
2021-06-17 13:30:26 -04:00
chemotaxis
682c15d52c Whitespace 2021-06-17 12:58:37 -04:00
Mislav Marohnić
4b2cded1f8 Ensure that tests for command factory never read from user's config
If these tests are going to exerise `factory.New()`, the config getter
should always be overriden since the default config getter reads from
`~/.config/gh` and thus makes tests dependent on the user's environment.
2021-06-17 17:59:34 +02:00
Mislav Marohnić
8ff42bf28c Fix repo override 2021-06-17 17:58:46 +02:00
Mislav Marohnić
8dd1e12f64 Merge remote-tracking branch 'origin' into fix-actions-help 2021-06-17 16:13:34 +02:00
Mislav Marohnić
94c1646209 Simplify gh actions implemenation
The command is now non-runnable, meaning it's exempt from auth check.
2021-06-17 16:02:00 +02:00
Mislav Marohnić
883943946a Add a global pre-run hook to handle auth check and repo override
With auth check being done via Cobra hooks, it is automatically skipped
for non-runnable commands and `-h/--help` flag usage.
2021-06-17 16:01:57 +02:00
chemotaxis
1e3bba5ff6 Add comment about cmd.Help()
The linter picked up that the error value from cmd.Help() isn't checked.

Even though cmd.Help() returns an error value, it's always nil. The
inner HelpFunc() function directly prints the error message instead of
returning an error value.
2021-06-16 22:28:41 -04:00
chemotaxis
558ff2dff0 Skip authentication message if asking for help
Currently, this still checks authentication, but we skip the
authentication message and exit normally.
2021-06-16 14:25:08 -04:00
chemotaxis
c903f1ecd0 Ask for and print help even if logged out
You have to explicitly ask for help using the help flags.  Otherwise,
`gh` will just print the authentication message.
2021-06-16 01:18:52 -04:00
Mislav Marohnić
dd3aac7f52
Merge pull request #3846 from cli/build-windows-fix
Improvements to build script on Windows
2021-06-15 18:52:03 +02:00
Sam
741f768a28
Merge pull request #3792 from chemotaxis/docs-install-via-conda
Document installing via Conda package manager
2021-06-15 12:19:24 -04:00
Sam
d299b74a37
Merge pull request #3841 from cli/factory-cleanup
Factory cleanup
2021-06-15 12:10:36 -04:00
Mislav Marohnić
bd01566251 Allow script\build as shorthand for go run script\build.go on Windows 2021-06-15 17:33:33 +02:00
Mislav Marohnić
32f9a462a8 Speed up build script by avoiding recursing into 3rd-party directories 2021-06-15 17:32:43 +02:00
Mislav Marohnić
cda406f495 Better error handling in build script on Windows
`script/build.go` could encounter an "Access is denied" error when the
project contains a symlink that could not be followed. This ignores such
errors with a warning and allows the build to resume.
2021-06-15 17:31:01 +02:00
Mislav Marohnić
543a17df7f
Merge pull request #3787 from cli/editor-tests
Allow explicitly empty body in issue/pr create
2021-06-15 16:16:59 +02:00
Sam Coe
edfac42384
Set up iostreams in factory default 2021-06-15 09:20:00 -04:00
Sam Coe
53fac59ef9
Cleanup factory/default and add tests 2021-06-15 09:19:16 -04:00
Sam
e380d68ed2
Merge pull request #3789 from cristiand391/increase-gh-pager-precedence
Increase `GH_PAGER` precedence
2021-06-15 09:18:57 -04:00
Mislav Marohnić
5984cf2a82
Merge pull request #3832 from cli/env-set-fix
Fix setting environment secrets
2021-06-14 16:17:24 +02:00
Mislav Marohnić
f7a786407d
Merge pull request #3834 from cristiand391/remove-unused-method
Remove unused method from `httpmock` package
2021-06-14 15:40:20 +02:00
Cristian Dominguez
d8ce615252 Remove unused method from httpmock package 2021-06-14 09:39:14 -03:00
Mislav Marohnić
3a7ce3a440 Fix setting environment secrets
This uses the correct public key when setting environment secrets.
https://docs.github.com/en/rest/reference/actions#get-an-environment-public-key
2021-06-14 11:51:20 +02:00
Mislav Marohnić
1f4bd80c56 Fix test flaky due to race in showing/hiding cursor
https://github.com/cli/cli/pull/3787/checks?check_run_id=2793254411
2021-06-14 10:58:53 +02:00
Nate Smith
aecfc01e69
Merge pull request #3809 from cli/fork-test-cleanup
fork tests cleanup
2021-06-11 11:31:33 -05:00
Mislav Marohnić
af90f72493
Merge pull request #3803 from cli/http-accept-header
Update "Accept" header for github.com requests
2021-06-11 14:38:52 +02:00
Mislav Marohnić
4debbb17cd Further separate out test cases 2021-06-11 14:32:08 +02:00
Mislav Marohnić
7dbaaf2eb7
Merge pull request #3804 from cli/pr-status-checks
Fix showing Checks information in `pr status`
2021-06-11 14:18:50 +02:00
Nate Smith
b0998772ae more cleanup 2021-06-10 21:46:02 +00:00
Nate Smith
f31a31e2ed stop stubbing out a Since function 2021-06-10 21:46:02 +00:00
vilmibm
4a7ec7f4f6 cleaning up fork tests 2021-06-10 21:45:54 +00:00
vilmibm
14de70a011 add defaultRemoteName 2021-06-10 21:44:49 +00:00
Mislav Marohnić
a4d1ce7709 Fix fetching information about the PR potentially being behind base branch 2021-06-10 15:51:27 +02:00
Mislav Marohnić
885e94786a Shorten GraphQL query for pr status --json 2021-06-10 15:37:58 +02:00
Mislav Marohnić
e1b5f78df3 💅 grammar in comment 2021-06-10 14:09:43 +02:00
vilmibm
395355d075 make prompt.Confirm stubbable 2021-06-08 15:49:37 -05:00