Commit graph

1923 commits

Author SHA1 Message Date
Cameron Booth
c38ca830be Extract shared.GetJob so we can use in rerun too 2022-03-03 11:10:22 -08:00
Cameron Booth
ff6c7b925f Add flag to rerun only failed jobs in a workflow run 2022-02-10 13:53:55 -08:00
Patrick Veverka
f6f8ba8b7b
Add display name for codespaces (#5044) 2022-02-09 16:15:03 +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
ba8c41a6ed
Add GH_HOST to hosts list if it has corresponding auth token (#5087)
* Add GH_HOST to hosts list if it has coresponding auth token

* Keep default host at front of hosts list

* Always add GH_HOST to hosts list
2022-01-29 07:37: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
Marwan Sulaiman
22c5269606
Fix flaky liveshare session test (#5111)
* Fix flaky liveshare session test

* typo

* PR comments
2022-01-27 11:20:50 -05: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
Mislav Marohnić
d0c7c4800a
Merge pull request #5047 from hirasawayuki/workflow-enable-cmd
Fix disabled_inactivity workflow can be changed to enable
2022-01-17 15:01:20 +01:00
Mislav Marohnić
df21025133 Add tests for release create from commit log, annotated tag 2022-01-17 14:23:05 +01:00
Mislav Marohnić
7090922713 💅 release create tests 2022-01-17 14:05:01 +01:00
Mislav Marohnić
e54b29e9cf Merge remote-tracking branch 'origin' into bugfix/release/create/no-tag-when-generated-available 2022-01-17 13:27:47 +01:00
Mislav Marohnić
a3f0940c62
Merge pull request #5032 from cli/ask-stubber
Improve Survey stubber for tests
2022-01-17 12:32:28 +01:00
hirasawayuki
44b9ff5ac5 Add tests to enable a workflow in the disabled_inactivity state 2022-01-16 22:22:08 +09:00
hirasawayuki
97d017e802 Add disabled_inactivity state 2022-01-16 12:40:55 +09:00
Mislav Marohnić
583af3e54c
Allow gh auth git-credential to authenticate GitHub Gist requests (#3064)
* Allow `gh auth git-credential` to authenticate GitHub Gist requests

When there are stored credentials for `example.com`, allow using them to
authenticate requests to `gist.example.com` as well.

* Fix writing out of credential config

* remove unneccessary function

* actually delete

Co-authored-by: nate smith <vilmibm@github.com>
2022-01-14 22:18:07 +00:00
nate smith
0a619d422a undo overzealous find/replace 2022-01-14 15:27:05 -06:00
Mislav Marohnić
44775f87c8 Add nolint directives to allow-list current lint violations 2022-01-14 19:52:52 +01:00
Mislav Marohnić
e43cb2b880 Port more legacy stubs to the new ask stubber 2022-01-14 19:34:15 +01:00