X Tutup
Skip to content

Commit 086d8ed

Browse files
committed
Merge remote-tracking branch 'origin' into color-env
2 parents a0e0f31 + 3049db6 commit 086d8ed

File tree

113 files changed

+6727
-890
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+6727
-890
lines changed

.github/CONTRIBUTING.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@
33
[legal]: https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license
44
[license]: ../LICENSE
55
[code-of-conduct]: CODE-OF-CONDUCT.md
6+
[bug issues]: https://github.com/cli/cli/issues?q=is%3Aopen+is%3Aissue+label%3Abug
7+
[feature request issues]: https://github.com/cli/cli/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement
68

79
Hi! Thanks for your interest in contributing to the GitHub CLI!
810

911
We accept pull requests for bug fixes and features where we've discussed the approach in an issue and given the go-ahead for a community member to work on it. We'd also love to hear about ideas for new features as issues.
1012

1113
Please do:
1214

15+
* check existing issues to verify that the [bug][bug issues] or [feature request][feature request issues] has not already been submitted
1316
* open an issue if things aren't working as expected
1417
* open an issue to propose a significant change
1518
* open a pull request to fix a bug
@@ -24,7 +27,7 @@ Please avoid:
2427

2528
Prerequisites:
2629
- Go 1.13+ for building the binary
27-
- Go 1.14+ for running the test suite
30+
- Go 1.15+ for running the test suite
2831

2932
Build with: `make` or `go build -o bin/gh ./cmd/gh`
3033

.github/ISSUE_TEMPLATE/feedback.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: "\U0001F4E3 Feedback"
3+
about: Give us general feedback about the GitHub CLI
4+
title: ''
5+
labels: feedback
6+
assignees: ''
7+
8+
---
9+
10+
# CLI Feedback
11+
12+
You can use this template to give us structured feedback or just wipe it and leave us a note. Thank you!
13+
14+
## What have you loved?
15+
16+
_eg "the nice colors"_
17+
18+
## What was confusing or gave you pause?
19+
20+
_eg "it did something unexpected"_
21+
22+
## Are there features you'd like to see added?
23+
24+
_eg "gh cli needs mini-games"_
25+
26+
## Anything else?
27+
28+
_eg "have a nice day"_

.github/workflows/releases.yml

Lines changed: 70 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,41 +27,85 @@ jobs:
2727
args: release --release-notes=CHANGELOG.md
2828
env:
2929
GITHUB_TOKEN: ${{secrets.UPLOAD_GITHUB_TOKEN}}
30-
- name: Bump homebrew-core formula
31-
uses: mislav/bump-homebrew-formula-action@v1
32-
if: "!contains(github.ref, '-')" # skip prereleases
33-
with:
34-
formula-name: gh
35-
download-url: https://github.com/cli/cli.git
36-
env:
37-
COMMITTER_TOKEN: ${{ secrets.UPLOAD_GITHUB_TOKEN }}
3830
- name: Checkout documentation site
39-
if: "!contains(github.ref, '-')" # skip prereleases
4031
uses: actions/checkout@v2
4132
with:
4233
repository: github/cli.github.com
4334
path: site
4435
fetch-depth: 0
4536
token: ${{secrets.SITE_GITHUB_TOKEN}}
46-
- name: Publish documentation site
47-
if: "!contains(github.ref, '-')" # skip prereleases
37+
- name: Update site man pages
4838
env:
4939
GIT_COMMITTER_NAME: cli automation
5040
GIT_AUTHOR_NAME: cli automation
5141
GIT_COMMITTER_EMAIL: noreply@github.com
5242
GIT_AUTHOR_EMAIL: noreply@github.com
53-
run: make site-publish
43+
run: make site-bump
5444
- name: Move project cards
55-
if: "!contains(github.ref, '-')" # skip prereleases
45+
continue-on-error: true
5646
env:
5747
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
5848
PENDING_COLUMN: 8189733
5949
DONE_COLUMN: 7110130
6050
run: |
61-
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
62-
api() { bin/hub api -H 'accept: application/vnd.github.inertia-preview+json' "$@"; }
51+
api() { gh api -H 'accept: application/vnd.github.inertia-preview+json' "$@"; }
52+
api-write() { [[ $GITHUB_REF == *-* ]] && echo "skipping: api $*" || api "$@"; }
6353
cards=$(api projects/columns/$PENDING_COLUMN/cards | jq ".[].id")
64-
for card in $cards; do api projects/columns/cards/$card/moves --field position=top --field column_id=$DONE_COLUMN; done
54+
for card in $cards; do
55+
api-write projects/columns/cards/$card/moves -f position=top -F column_id=$DONE_COLUMN
56+
done
57+
58+
- name: Install packaging dependencies
59+
run: sudo apt-get install -y createrepo rpm reprepro
60+
- name: Set up GPG
61+
run: |
62+
gpg --import --no-tty --batch --yes < script/pubkey.asc
63+
echo "${{secrets.GPG_KEY}}" | base64 -d | gpg --import --no-tty --batch --yes
64+
echo "allow-preset-passphrase" > ~/.gnupg/gpg-agent.conf
65+
gpg-connect-agent RELOADAGENT /bye
66+
echo "${{secrets.GPG_PASSPHRASE}}" | /usr/lib/gnupg2/gpg-preset-passphrase --preset 867DAD5051270B843EF54F6186FA10E3A1D22DC5
67+
- name: Sign RPMs
68+
run: |
69+
cp script/rpmmacros ~/.rpmmacros
70+
rpmsign --addsign dist/*.rpm
71+
- name: Run createrepo
72+
run: |
73+
mkdir -p site/packages/rpm
74+
cp dist/*.rpm site/packages/rpm/
75+
createrepo site/packages/rpm
76+
pushd site/packages/rpm
77+
gpg --yes --detach-sign --armor repodata/repomd.xml
78+
popd
79+
- name: Run reprepro
80+
env:
81+
RELEASES: "focal stable bionic trusty precise xenial"
82+
run: |
83+
mkdir -p upload
84+
for release in $RELEASES; do
85+
for file in dist/*.deb; do
86+
reprepro --confdir="+b/script" includedeb "$release" "$file"
87+
done
88+
done
89+
cp -a dists/ pool/ upload/
90+
mkdir -p site/packages
91+
cp -a upload/* site/packages/
92+
- name: Publish site
93+
env:
94+
GIT_COMMITTER_NAME: cli automation
95+
GIT_AUTHOR_NAME: cli automation
96+
GIT_COMMITTER_EMAIL: noreply@github.com
97+
GIT_AUTHOR_EMAIL: noreply@github.com
98+
working-directory: ./site
99+
run: |
100+
git add packages
101+
git commit -m "Add rpm and deb packages for ${GITHUB_REF#refs/tags/}"
102+
if [[ $GITHUB_REF == *-* ]]; then
103+
git log --oneline @{upstream}..
104+
git diff --name-status @{upstream}..
105+
else
106+
git push
107+
fi
108+
65109
msi:
66110
needs: goreleaser
67111
runs-on: windows-latest
@@ -72,8 +116,7 @@ jobs:
72116
id: download_exe
73117
shell: bash
74118
run: |
75-
curl -fsSL https://github.com/github/hub/raw/master/script/get | bash -s 2.14.1
76-
bin/hub release download "${GITHUB_REF#refs/tags/}" -i '*windows_amd64*.zip'
119+
hub release download "${GITHUB_REF#refs/tags/}" -i '*windows_amd64*.zip'
77120
printf "::set-output name=zip::%s\n" *.zip
78121
unzip -o *.zip && rm -v *.zip
79122
env:
@@ -106,6 +149,14 @@ jobs:
106149
-Executable "${{ steps.buildmsi.outputs.msi }}"
107150
- name: Upload MSI
108151
shell: bash
109-
run: bin/hub release edit "${GITHUB_REF#refs/tags/}" -m "" -a "${{ steps.buildmsi.outputs.msi }}"
152+
run: hub release edit "${GITHUB_REF#refs/tags/}" -m "" --draft=false -a "${{ steps.buildmsi.outputs.msi }}"
110153
env:
111154
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
155+
- name: Bump homebrew-core formula
156+
uses: mislav/bump-homebrew-formula-action@v1
157+
if: "!contains(github.ref, '-')" # skip prereleases
158+
with:
159+
formula-name: gh
160+
download-url: https://github.com/cli/cli.git
161+
env:
162+
COMMITTER_TOKEN: ${{ secrets.UPLOAD_GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ project_name: gh
22

33
release:
44
prerelease: auto
5+
draft: true # we only publish after the Windows MSI gets uploaded
56

67
before:
78
hooks:
@@ -49,32 +50,6 @@ archives:
4950
files:
5051
- LICENSE
5152

52-
brews:
53-
- name: gh
54-
ids: [nix]
55-
github:
56-
owner: github
57-
name: homebrew-gh
58-
skip_upload: auto
59-
description: GitHub CLI
60-
homepage: https://github.com/cli/cli
61-
folder: Formula
62-
custom_block: |
63-
head do
64-
url "https://github.com/cli/cli.git", :branch => "trunk"
65-
depends_on "go"
66-
end
67-
install: |
68-
system "make", "bin/gh", "manpages" if build.head?
69-
bin.install "bin/gh"
70-
man1.install Dir["./share/man/man1/gh*.1"]
71-
(bash_completion/"gh.sh").write `#{bin}/gh completion -s bash`
72-
(zsh_completion/"_gh").write `#{bin}/gh completion -s zsh`
73-
(fish_completion/"gh.fish").write `#{bin}/gh completion -s fish`
74-
test: |
75-
help_text = shell_output("#{bin}/gh --help")
76-
assert_includes help_text, "Usage:"
77-
7853
nfpms:
7954
- license: MIT
8055
maintainer: GitHub

Makefile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ endif
2222
GO_LDFLAGS := -X github.com/cli/cli/command.Version=$(GH_VERSION) $(GO_LDFLAGS)
2323
GO_LDFLAGS := -X github.com/cli/cli/command.BuildDate=$(BUILD_DATE) $(GO_LDFLAGS)
2424
ifdef GH_OAUTH_CLIENT_SECRET
25-
GO_LDFLAGS := -X github.com/cli/cli/internal/config.oauthClientID=$(GH_OAUTH_CLIENT_ID) $(GO_LDFLAGS)
26-
GO_LDFLAGS := -X github.com/cli/cli/internal/config.oauthClientSecret=$(GH_OAUTH_CLIENT_SECRET) $(GO_LDFLAGS)
25+
GO_LDFLAGS := -X github.com/cli/cli/internal/authflow.oauthClientID=$(GH_OAUTH_CLIENT_ID) $(GO_LDFLAGS)
26+
GO_LDFLAGS := -X github.com/cli/cli/internal/authflow.oauthClientSecret=$(GH_OAUTH_CLIENT_SECRET) $(GO_LDFLAGS)
2727
endif
2828

2929
bin/gh: $(BUILD_FILES)
@@ -46,15 +46,14 @@ site-docs: site
4646
git -C site commit -m 'update help docs' || true
4747
.PHONY: site-docs
4848

49-
site-publish: site-docs
49+
site-bump: site-docs
5050
ifndef GITHUB_REF
5151
$(error GITHUB_REF is not set)
5252
endif
5353
sed -i.bak -E 's/(assign version = )".+"/\1"$(GITHUB_REF:refs/tags/v%=%)"/' site/index.html
5454
rm -f site/index.html.bak
5555
git -C site commit -m '$(GITHUB_REF:refs/tags/v%=%)' index.html
56-
git -C site push
57-
.PHONY: site-publish
56+
.PHONY: site-bump
5857

5958

6059
.PHONY: manpages

README.md

Lines changed: 14 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,29 @@ the terminal next to where you are already working with `git` and your code.
99

1010
While in beta, GitHub CLI is available for repos hosted on GitHub.com only. It currently does not support repositories hosted on GitHub Enterprise Server or other hosting providers. We are planning on adding support for GitHub Enterprise Server after GitHub CLI is out of beta (likely towards the end of 2020), and we want to ensure that the API endpoints we use are more widely available for GHES versions that most GitHub customers are on.
1111

12-
## We need your feedback
12+
## We want your feedback
1313

14-
GitHub CLI is currently in its early development stages, and we're hoping to get feedback from people using it.
15-
16-
If you've installed and used `gh`, we'd love for you to take a short survey here (no more than five minutes): https://forms.gle/umxd3h31c7aMQFKG7
17-
18-
And if you spot bugs or have features that you'd really like to see in `gh`, please check out the [contributing page][]
14+
We'd love to hear your feedback about `gh`. If you spot bugs or have features that you'd really like to see in `gh`, please check out the [contributing page][].
1915

2016
## Usage
2117

2218
- `gh pr [status, list, view, checkout, create]`
2319
- `gh issue [status, list, view, create]`
2420
- `gh repo [view, create, clone, fork]`
21+
- `gh auth [login, logout, refresh, status]`
2522
- `gh config [get, set]`
2623
- `gh help`
2724

2825
## Documentation
2926

30-
Read the [official docs](https://cli.github.com/manual/) for more information.
27+
Read the [official docs][] for more information.
3128

3229
## Comparison with hub
3330

3431
For many years, [hub][] was the unofficial GitHub CLI tool. `gh` is a new project that helps us explore
3532
what an official GitHub CLI tool can look like with a fundamentally different design. While both
3633
tools bring GitHub to the terminal, `hub` behaves as a proxy to `git`, and `gh` is a standalone
37-
tool. Check out our [more detailed explanation](/docs/gh-vs-hub.md) to learn more.
34+
tool. Check out our [more detailed explanation][gh-vs-hub] to learn more.
3835

3936

4037
<!-- this anchor is linked to from elsewhere, so avoid renaming it -->
@@ -72,6 +69,10 @@ Upgrade:
7269
sudo port selfupdate && sudo port upgrade gh
7370
```
7471

72+
### Linux
73+
74+
See [Linux installation docs](/docs/install_linux.md).
75+
7576
### Windows
7677

7778
`gh` is available via [scoop][], [Chocolatey][], and as downloadable MSI.
@@ -109,61 +110,20 @@ choco upgrade gh
109110

110111
MSI installers are available for download on the [releases page][].
111112

112-
### Debian/Ubuntu Linux
113-
114-
Install and upgrade:
115-
116-
1. Download the `.deb` file from the [releases page][];
117-
2. Install the downloaded file: `sudo apt install ./gh_*_linux_amd64.deb`
118-
119-
### Fedora Linux
120-
121-
Install and upgrade:
122-
123-
1. Download the `.rpm` file from the [releases page][];
124-
2. Install the downloaded file: `sudo dnf install gh_*_linux_amd64.rpm`
125-
126-
### Centos Linux
127-
128-
Install and upgrade:
129-
130-
1. Download the `.rpm` file from the [releases page][];
131-
2. Install the downloaded file: `sudo yum localinstall gh_*_linux_amd64.rpm`
132-
133-
### openSUSE/SUSE Linux
134-
135-
Install and upgrade:
136-
137-
1. Download the `.rpm` file from the [releases page][];
138-
2. Install the downloaded file: `sudo zypper in gh_*_linux_amd64.rpm`
139-
140-
### Arch Linux
141-
142-
Arch Linux users can install from the [community repo](https://www.archlinux.org/packages/community/x86_64/github-cli/):
143-
144-
```bash
145-
pacman -S github-cli
146-
```
147-
148-
### Android
149-
150-
Android users can install via Termux:
151-
152-
```bash
153-
pkg install gh
154-
```
155-
156113
### Other platforms
157114

158115
Download packaged binaries from the [releases page][].
159116

160117
### Build from source
161118

162-
See here on how to [build GitHub CLI from source](/docs/source.md).
119+
See here on how to [build GitHub CLI from source][build from source].
120+
163121

164-
[docs]: https://cli.github.com/manual
122+
[official docs]: https://cli.github.com/manual
165123
[scoop]: https://scoop.sh
166124
[Chocolatey]: https://chocolatey.org
167125
[releases page]: https://github.com/cli/cli/releases/latest
168126
[hub]: https://github.com/github/hub
169127
[contributing page]: https://github.com/cli/cli/blob/trunk/.github/CONTRIBUTING.md
128+
[gh-vs-hub]: /docs/gh-vs-hub.md
129+
[build from source]: /docs/source.md

0 commit comments

Comments
 (0)
X Tutup