X Tutup
Skip to content

Commit 97b52b3

Browse files
committed
Merge branch 'trunk' of github.com:cli/cli into jg/liveshare-keepalive
2 parents 5170a29 + 675ee31 commit 97b52b3

File tree

28 files changed

+742
-281
lines changed

28 files changed

+742
-281
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gomod
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
interval: "daily"

.github/workflows/codeql.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ name: Code Scanning
22

33
on:
44
push:
5+
branches: [trunk]
56
pull_request:
7+
branches: [trunk]
8+
paths-ignore:
9+
- '**/*.md'
610
schedule:
711
- cron: "0 0 * * 0"
812

.github/workflows/prauto.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
PRNUM: ${{ github.event.pull_request.number }}
1616
PRHEAD: ${{ github.event.pull_request.head.label }}
1717
PRAUTHOR: ${{ github.event.pull_request.user.login }}
18+
PR_AUTHOR_TYPE: ${{ github.event.pull_request.user.type }}
1819
if: "!github.event.pull_request.draft"
1920
run: |
2021
commentPR () {
@@ -42,7 +43,7 @@ jobs:
4243
' -f colID="$(colID "Needs review")" -f prID="$PRID"
4344
}
4445
45-
if gh api orgs/cli/public_members/$PRAUTHOR --silent 2>/dev/null
46+
if [ "$PR_AUTHOR_TYPE" = "Bot" ] || gh api orgs/cli/public_members/$PRAUTHOR --silent 2>/dev/null
4647
then
4748
if ! errtext="$(addToBoard 2>&1)"
4849
then

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ If anything feels off, or if you feel that some functionality is missing, please
1919

2020
### macOS
2121

22-
`gh` is available via [Homebrew][], [MacPorts][], [Conda][], and as a downloadable binary from the [releases page][].
22+
`gh` is available via [Homebrew][], [MacPorts][], [Conda][], [Spack][], and as a downloadable binary from the [releases page][].
2323

2424
#### Homebrew
2525

@@ -41,15 +41,21 @@ If anything feels off, or if you feel that some functionality is missing, please
4141

4242
Additional Conda installation options available on the [gh-feedstock page](https://github.com/conda-forge/gh-feedstock#installing-gh).
4343

44+
#### Spack
45+
46+
| Install: | Upgrade: |
47+
| ------------------ | ---------------------------------------- |
48+
| `spack install gh` | `spack uninstall gh && spack install gh` |
49+
4450
### Linux & BSD
4551

46-
`gh` is available via [Homebrew](#homebrew), [Conda](#Conda), and as downloadable binaries from the [releases page][].
52+
`gh` is available via [Homebrew](#homebrew), [Conda](#conda), [Spack](#spack), and as downloadable binaries from the [releases page][].
4753

4854
For instructions on specific distributions and package managers, see [Linux & BSD installation](./docs/install_linux.md).
4955

5056
### Windows
5157

52-
`gh` is available via [WinGet][], [scoop][], [Chocolatey][], [Conda](#Conda), and as downloadable MSI.
58+
`gh` is available via [WinGet][], [scoop][], [Chocolatey][], [Conda](#conda), and as downloadable MSI.
5359

5460
#### WinGet
5561

@@ -99,6 +105,7 @@ tool. Check out our [more detailed explanation][gh-vs-hub] to learn more.
99105
[scoop]: https://scoop.sh
100106
[Chocolatey]: https://chocolatey.org
101107
[Conda]: https://docs.conda.io/en/latest/
108+
[Spack]: https://spack.io
102109
[releases page]: https://github.com/cli/cli/releases/latest
103110
[hub]: https://github.com/github/hub
104111
[contributing]: ./.github/CONTRIBUTING.md

api/queries_pr.go

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ package api
22

33
import (
44
"context"
5-
"errors"
65
"fmt"
7-
"io"
86
"net/http"
97
"strings"
108
"time"
@@ -267,30 +265,6 @@ func (pr *PullRequest) DisplayableReviews() PullRequestReviews {
267265
return PullRequestReviews{Nodes: published, TotalCount: len(published)}
268266
}
269267

270-
func (c Client) PullRequestDiff(baseRepo ghrepo.Interface, prNumber int) (io.ReadCloser, error) {
271-
url := fmt.Sprintf("%srepos/%s/pulls/%d",
272-
ghinstance.RESTPrefix(baseRepo.RepoHost()), ghrepo.FullName(baseRepo), prNumber)
273-
req, err := http.NewRequest("GET", url, nil)
274-
if err != nil {
275-
return nil, err
276-
}
277-
278-
req.Header.Set("Accept", "application/vnd.github.v3.diff; charset=utf-8")
279-
280-
resp, err := c.http.Do(req)
281-
if err != nil {
282-
return nil, err
283-
}
284-
285-
if resp.StatusCode == 404 {
286-
return nil, errors.New("pull request not found")
287-
} else if resp.StatusCode != 200 {
288-
return nil, HandleHTTPError(resp)
289-
}
290-
291-
return resp.Body, nil
292-
}
293-
294268
type pullRequestFeature struct {
295269
HasReviewDecision bool
296270
HasStatusCheckRollup bool

api/queries_repo.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,25 @@ func (r Repository) ViewerCanTriage() bool {
230230
}
231231
}
232232

233+
func FetchRepository(client *Client, repo ghrepo.Interface, fields []string) (*Repository, error) {
234+
query := fmt.Sprintf(`query RepositoryInfo($owner: String!, $name: String!) {
235+
repository(owner: $owner, name: $name) {%s}
236+
}`, RepositoryGraphQL(fields))
237+
238+
variables := map[string]interface{}{
239+
"owner": repo.RepoOwner(),
240+
"name": repo.RepoName(),
241+
}
242+
243+
var result struct {
244+
Repository Repository
245+
}
246+
if err := client.GraphQL(repo.RepoHost(), query, variables, &result); err != nil {
247+
return nil, err
248+
}
249+
return InitRepoHostname(&result.Repository, repo.RepoHost()), nil
250+
}
251+
233252
func GitHubRepo(client *Client, repo ghrepo.Interface) (*Repository, error) {
234253
query := `
235254
fragment repo on Repository {

go.mod

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,27 @@ go 1.16
55
require (
66
github.com/AlecAivazis/survey/v2 v2.3.2
77
github.com/MakeNowJust/heredoc v1.0.0
8-
github.com/briandowns/spinner v1.11.1
8+
github.com/briandowns/spinner v1.16.0
99
github.com/charmbracelet/glamour v0.3.0
1010
github.com/cli/browser v1.1.0
1111
github.com/cli/oauth v0.8.0
1212
github.com/cli/safeexec v1.0.0
13-
github.com/cpuguy83/go-md2man/v2 v2.0.0
14-
github.com/creack/pty v1.1.13
13+
github.com/cpuguy83/go-md2man/v2 v2.0.1
14+
github.com/creack/pty v1.1.16
1515
github.com/fatih/camelcase v1.0.0
16-
github.com/gabriel-vasile/mimetype v1.1.2
17-
github.com/google/go-cmp v0.5.5
16+
github.com/gabriel-vasile/mimetype v1.4.0
17+
github.com/google/go-cmp v0.5.6
1818
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
1919
github.com/gorilla/websocket v1.4.2
20-
github.com/hashicorp/go-version v1.2.1
20+
github.com/hashicorp/go-version v1.3.0
2121
github.com/henvic/httpretty v0.0.6
22-
github.com/itchyny/gojq v0.12.4
22+
github.com/itchyny/gojq v0.12.5
2323
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
24-
github.com/mattn/go-colorable v0.1.8
25-
github.com/mattn/go-isatty v0.0.13
24+
github.com/mattn/go-colorable v0.1.11
25+
github.com/mattn/go-isatty v0.0.14
2626
github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d
2727
github.com/muesli/reflow v0.2.1-0.20210502190812-c80126ec2ad5
28-
github.com/muesli/termenv v0.8.1
28+
github.com/muesli/termenv v0.9.0
2929
github.com/muhammadmuzzammil1998/jsonc v0.0.0-20201229145248-615b0916ca38
3030
github.com/olekukonko/tablewriter v0.0.5
3131
github.com/opentracing/opentracing-go v1.1.0
@@ -39,7 +39,7 @@ require (
3939
github.com/stretchr/testify v1.7.0
4040
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97
4141
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
42-
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1
42+
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6
4343
golang.org/x/term v0.0.0-20210503060354-a79de5458b56
4444
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
4545
)

0 commit comments

Comments
 (0)
X Tutup