* 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>
* 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>
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>
- 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]
```
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.