Commit graph

1816 commits

Author SHA1 Message Date
Mark Phelps
dd5feda00a Update wording after consulting product 2022-02-25 17:32:08 -05:00
Mark Phelps
71f32376d0 Fix tests 2022-02-22 20:20:52 -05:00
Mark Phelps
707220a9b1 PR updates 2022-02-22 14:16:03 -05:00
Mark Phelps
1ea26f33d8 Add create test 2022-02-22 09:50:43 -05:00
Mark Phelps
e7c2f973ae Support opting out of permissions 2022-02-17 15:11:12 -05:00
Mark Phelps
84aad52b22
Merge branch 'cli:trunk' into codespaces-accept-perms 2022-02-16 10:08:49 -05:00
Mark Phelps
590acaa1d6 WIP 2022-02-15 19:35:53 -05:00
Josh Gross
c2a9c5a74b
Support filtering pull requests authored by GitHub Apps (#5180) 2022-02-15 19:36:06 +01:00
Mislav Marohnić
5d36bcc4de Merge remote-tracking branch 'origin' into fix/release-discussion-category 2022-02-15 18:28:08 +01:00
Mislav Marohnić
72340076ae tests 2022-02-15 18:27:58 +01:00
Breno Silva
6e14426dfb
docs: improve repo edit docs (#5165)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-02-15 17:35:30 +01:00
Sam Coe
28d2b52769
release create: warn about unpushed local git tag (#5104)
If `gh release create <TAG>` was called and TAG exists locally but not on the remote, this warns about the unpushed tag to avoid recreating it on the remote. The user can pass a value for `--target` to silence the warning.
2022-02-15 16:36:37 +01:00
Mislav Marohnić
0a5e220231 Ignore EPIPE errors when writing to a closed pager
While a gh command is writing stdout to a pager, the user may choose to
close the pager program before the pager has read all the data on its
standard input. In that case, the parent gh process will receive an
EPIPE error, which would bubble up its error handling and cause it to
print something like:

    write |1: broken pipe

Since this was caused by an explicit user action of closing the pager,
and since the user probably doesn't want to see this uninformative
error, this informs our global error handling of this error and causes
it to be ignored.
2022-02-10 16:42:00 +01:00
Mislav Marohnić
c9f44ffda9
Merge pull request #5186 from cli/credential-helper-fix
Fix authenticating git operations after `auth login --with-token`
2022-02-10 15:59:41 +01:00
Patrick Veverka
f6f8ba8b7b
Add display name for codespaces (#5044) 2022-02-09 16:15:03 +01:00
Mislav Marohnić
6701b526d1 Fix authenticating git operations after auth login --with-token
After completing the interactive `gh auth login` flow, the `hosts.yml`
config file will have been populated with both `oauth_token` and `user`
properties for the GitHub host. However, after `auth login --with-token`
only the `oauth_token` is persisted but no username.

This fixes `auth git-credential` behavior so it allows authentication
even if the `user` property is missing. It's entirely optional to send a
proper username for git authentication, since GitHub seems to ignore the
actual value sent and just focuses on the token itself.
2022-02-09 00:10:10 +01:00
endorama
825328031f
Add watch functionality to pr checks command (#4519)
* pr-checks: extract webMode

* pr-checks: extract checks information collection

* pr-checks: extract output utilities

* pr-checks: implement watch flag

* pr-checks: remove SIGINT interceptor

* pr-checks: exit with error if some task has failed

* update flags help text

* update default interval to 10s

* move interval flag parse to RunE

* refactor checksRunWatchMode to use infinite loop

* Refactor printTable function

* Refactor collect function

* Set up checksRun to use new refactored functions and simplify logic a bit

* Add tests

* Always set interval in opts

* use Duration flag

* Revert back to using int flag for consistency with run watch

* Use run watch screen clearing mechanism

* Re-add pager support

Co-authored-by: Sam Coe <samcoe@users.noreply.github.com>
2022-02-08 08:33:42 +01:00
Josh Gross
f43574bfe0
Correctly handle Windows paths when creating gists 2022-02-06 23:21:20 +00:00
Yuki Hirasawa
4f0264e37b
spelling: possible (#5157) 2022-02-02 16:54:09 +01:00
Mislav Marohnić
6a4f374caf
Enable repo override for repo deploy-key delete (#5152) 2022-02-01 11:40:34 +00:00
Mislav Marohnić
4a3ef50d2d
Standardize pager output across commands (#5141)
Add pager functionality to the following commands:
- gist list
- pr checks
- release list
- run list
- run view
- secret list
- workflow list
- workflow view

Additionally, normalize error handling when starting the pager has
failed: only print a non-fatal notice to stderr instead of aborting the
whole command.
2022-02-01 08:36:51 +01:00
Kevin Lee
0d143ca89c
Consistent punctuation in command usages (#5139)
* Fix spelling and grammatical errors in command docs
* Add periods for consistency across the long command descriptions
* Format imports
2022-01-31 10:56:12 +00:00
Caleb Brose
eeeb73a3e3
Repo name suggestions for cs create (#5108)
Co-authored-by: Alan Donovan <alan@alandonovan.net>
2022-01-31 10:20:49 +00:00
Sam Coe
f0b60e3530
Add non-local PR template support (#5097)
* Add non-local PR template support

* Consolidate template support functions

* Change back query name
2022-01-29 07:41:24 +00:00
Sam Coe
3be4b9951d
Trim leading and trailing whitespace when setting secrets from stdin (#5086)
* Trim leading and trailing whitespace when setting secrets from stdin

* Only trim newline at end of string
2022-01-29 09:32:14 +02:00
Sam Coe
e68aa12564
Dont execute jq filters or templates when api requests are not successful (#5088) 2022-01-29 09:32:01 +02:00
yasudanaoya
b77c37df0f
feat: add job id, into run view suggest command (#5105)
* feat: add job id, into run view suggest command

* fix: dry

* fix: run id to job id

* Change "a" to "the" when referencing a single job

Co-authored-by: Sam Coe <samcoe@users.noreply.github.com>
2022-01-27 08:19:37 +00:00
Nate Smith
3a088e4df5
Merge pull request #5069 from hirasawayuki/fix-pr-checks-cmd
Fix duplicates check results returned by `gh pr checks`
2022-01-26 16:46:32 -06:00
Nate Smith
e17964cf03
Merge pull request #5092 from cli/repo-fork-proto
prefer configured git protocol when forking
2022-01-26 11:33:47 -06:00
Anton Baklanov
e28fa3c112
Add branch and actor filters to run list (#4100)
* Add branch and actor filters to `run list`

* Simplify what FilterOptions can do

* Check not only limit in TestNewCmdList

* Verify that branch/actor params are parsed properly

* Verify that API requests have proper query parameters

* Change flag name from actor to user

Co-authored-by: Sam Coe <samcoe@users.noreply.github.com>
2022-01-26 08:14:56 +02:00
nate smith
667671f048 fix race condition, increase clarity 2022-01-25 15:36:41 -06:00
nate smith
bd6e50a08a Merge remote-tracking branch 'origin/trunk' into feature/target-repo-fork-name 2022-01-25 14:08:27 -06:00
Nilesh Singh
47a6aff54a
Add repo deploy key commands (#4302)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-01-25 17:48:24 +00:00
Sam Coe
603502febf
Allow PR create to create PRs with numerical branch names (#5090) 2022-01-25 07:22:28 +02:00
nate smith
2f19fa792f maint: clean up some errors 2022-01-24 17:34:21 -06:00
nate smith
de4e37ed75 Merge remote-tracking branch 'origin/trunk' into feat/gist-edit 2022-01-24 17:34:09 -06:00
nate smith
0d214864d9 linter appeasement 2022-01-24 17:01:19 -06:00
nate smith
170a50fcc8 prefer configured git protocol when forking 2022-01-24 16:54:01 -06:00
Des Preston
2e07d0f32c
pr status: show number of approvals (#4240)
If the base branch has no minimum approval requirements, show "N Approved"
reviews. Otherwise, show "N/X Approved".

Co-authored-by: Mislav Marohnić <mislav@github.com>
2022-01-21 15:58:15 +00:00
Sam Coe
d3076463aa
Rename gpg-key and ssh-key files to fit golang common practices (#5074) 2022-01-21 16:51:16 +02:00
Adarsh K Kumar
bb3070aaa0
#4258 Add sub command to delete asset from release (#4416)
* #4258 Add sub command to delete asset from release

* Add just a bit of polish

Co-authored-by: Sam Coe <samcoe@users.noreply.github.com>
2022-01-21 15:49:36 +02:00
Mislav Marohnić
4340c65ad9
Merge pull request #5040 from cli/issues-by-milestone-fix
Fix filtering issues by milestone
2022-01-21 14:47:40 +01:00
Mislav Marohnić
fac020eb39
Merge pull request #5063 from issyl0/repo-envvar-compatible-with-gh-api
cmd/api: Respect `GH_REPO` when substituting `{owner}/{repo}`
2022-01-20 18:16:10 +01:00
hirasawayuki
b0fd9c6f04 Fix duplicates check results returned by gh pr checks 2022-01-21 00:02:42 +09:00
Issy Long
8c2695b4a0
cmd/api: Respect GH_REPO when substituting {owner}/{repo}
- This fixes issue 5061.
- Previously, a user could set `GH_REPO=TestOrg/repo` and run `gh api
  repos/{owner}/{repo}/releases` expecting to see the releases from
  `TestOrg/repo` but instead see releases from the current git repo
  they're in.
- Or, worse, if the user ran the command from outside of a git repo,
  they'd see a "not a git repo" error from git itself.
- This was different to `GH_REPO=TestOrg/repo gh release list` which
  successfully lists `TestOrg/repo`'s releases.

----

Before:

```shell
$ cd repos/issyl0/not-a-git-repo
$ GH_REPO=issyl0/terraform-provider-improvmx gh api repos/{owner}/{repo}/releases
unable to expand placeholder in path: fatal: not a git repository (or any of the parent directories): .git
/opt/homebrew/bin/git: exit status 128
```

```shell
$ cd repos/issyl0/a-git-repo-with-no-releases
$ GH_REPO=issyl0/terraform-provider-improvmx gh api repos/{owner}/{repo}/releases
[]
```

After:

```shell
$ cd repos/issyl0/not-a-git-repo
$ GH_REPO=issyl0/terraform-provider-improvmx ../../cli/cli/bin/gh api repos/{owner}/{repo}/releases
[lots of JSON about GH_REPO's releases - success]
```

```shell
$ cd repos/issyl0/a-git-repo-with-no-releases
$ GH_REPO=issyl0/terraform-provider-improvmx ../../cli/cli/bin/gh api repos/{owner}/{repo}/releases
[lots of JSON about GH_REPO's releases - success]
```
2022-01-19 23:16:13 +00:00
nate smith
c32bf6387e update wording for extensions that cannot be installed 2022-01-19 11:44:05 -06:00
Mislav Marohnić
66c18b40f2
Handle SAML enforcement challenge from the server (#5054)
Whenever a SSO challenge gets issued by the server by means of a URL in
the `X-GitHub-SSO` response header, gh now additionally prints that URL
on the standard error stream.

This is achieved by installing a middleware to all HTTP requests and
storing the server challenge to a value accessible by `factory.SSOURL()`.
Such approach was made necessary mainly because of the
`shurcool-graphql` client which doesn't give access to response headers
when a GraphQL error case is encountered.
2022-01-19 14:22:22 +01:00
Nate Smith
f950637b0b
Merge pull request #4738 from SteadBytes/gist-edit-description
Support editing gist description
2022-01-18 09:34:22 -06:00
Mislav Marohnić
4fd208fd59 Fix legacy prompt stub that is tripping up the linter 2022-01-17 19:39:12 +01:00
Nate Smith
4b415f80d7
Merge pull request #5022 from cli/config-defaults
add GetOrDefault and related methods to Config
2022-01-17 10:44:28 -06:00