Commit graph

3199 commits

Author SHA1 Message Date
Mislav Marohnić
896f2273e8
Merge pull request #3021 from g14a/bug/gist-deletion
Accept only one argument when deleting a gist
2021-02-24 15:37:06 +01:00
Gowtham Munukutla
66d4307bce return msg instead of too many arguments 2021-02-24 18:05:11 +05:30
Gowtham Munukutla
79b77b4273 Merge branch 'trunk' of https://github.com/cli/cli into bug/gist-deletion 2021-02-24 15:54:29 +05:30
Gowtham Munukutla
61eb7eeeab Add msg in gist delete 2021-02-24 15:53:07 +05:30
Gowtham Munukutla
56ead91702 Add helper function to validate exact args in cmdutil 2021-02-24 15:49:40 +05:30
Mislav Marohnić
98df059e84
Merge pull request #3020 from cli/brew-upgrade-notice
Avoid upgrade notice for recent release if gh is under Homebrew prefix
2021-02-23 21:04:57 +01:00
Mislav Marohnić
c5af4ddfdc
Merge pull request #3009 from cli/git-credential-env
Fix `auth git-credential` when the token comes from environment
2021-02-23 16:32:23 +01:00
Gowtham Munukutla
cbf8a0d964 Accept only one argument when deleting a gist 2021-02-23 20:12:26 +05:30
Mislav Marohnić
27aea42d8a Avoid upgrade notice for recent release if gh is under Homebrew prefix
Before, when gh detected there was a new release in the `cli/cli` repo,
it would show this notice:

    A new release of gh is available: {V1} → {V2}

Additionally, when the release was more than 24h old, we would show this
to Homebrew users:

    To upgrade, run: brew update && brew upgrade gh

Ref. feb4acc2c0

This change makes it so that the original notice "A new release of gh is
available" is NOT shown to Homebrew users unless the release is older
than 24h. We effectively hide the fact that any release happened until
we're sure that the version bump has made it to `homebrew-core`.
2021-02-23 12:24:51 +01:00
Mislav Marohnić
d6798b1852
Merge pull request #3019 from cli/ghe-paste-token
Fix pasting Personal Access Token to `auth login` for GHE
2021-02-23 11:34:02 +01:00
Mislav Marohnić
cfddda8829 Indicate workflow scope is GHE 3.0+ only during auth login 2021-02-23 10:52:29 +01:00
Mislav Marohnić
f807795491 Fix pasting Personal Access Token to auth login for GHE 2021-02-23 10:19:11 +01:00
Mislav Marohnić
9bf1668b3f Fix auth git-credential when the token comes from environment
When a token such as GH_TOKEN is set through environment variables and
`~/.config/gh/hosts.yml` is non-existent, the `auth git-credential get`
command used to fail due to missing username.

Since GitHub username isn't at all required for token authentication,
use the `x-access-token` faux username instead of trying to obtain one
from a config file.
2021-02-19 15:37:11 +01:00
Mislav Marohnić
04dcb327ca
Merge pull request #2996 from cli/ghe-branchprotectionrule
Fix `pr status` for GHE 2.22 and older
2021-02-18 19:41:04 +01:00
Mislav Marohnić
dcff6c4f2d Fix pr status for GHE 2.22 and older
This queries for the availability of the `branchProtectionRule` field on
"Ref" before trying to request it from GraphQL.
2021-02-18 17:46:13 +01:00
Nate Smith
2f563babbf
Merge pull request #2990 from cli/ssh-key-commands
Add `ssh-key add` command and publish `ssh-key`
2021-02-17 14:30:37 -06:00
Mislav Marohnić
1a9e42ed55 Add ssh-key add command and publish ssh-key 2021-02-17 19:46:59 +01:00
Nate Smith
e91b97b4c5
fully restore fork remote renaming behavior (#2982)
* fully restore fork remote renaming behavior

* catch blank remote name and error + arg tests

* hard wrap fork usage

* do not rename if remote-name supplied

* tweak error text
2021-02-17 12:33:22 -06:00
Nate Smith
4a897f70c3
Merge pull request #2962 from ulwlu/fix_prompt_string_when_creating_remote_repository
Fix prompt string when creating remote repository
2021-02-17 12:32:27 -06:00
Mislav Marohnić
c148a9ba24
Merge pull request #2989 from cli/pr-merge-immediate-edit
pr merge: avoid prompting to enter editor after editing phase is chosen
2021-02-17 19:26:17 +01:00
Mislav Marohnić
a90997ec95 pr merge: avoid prompting to enter editor after editing phase is chosen
When user chooses "Edit commit message", open the editor immediately
instead of showing an additional prompt to open the editor.
2021-02-17 18:47:17 +01:00
Mislav Marohnić
70d4786e37
Merge pull request #2988 from cli/strict-status-checks-base
pr status: fix checking branch protection rules on the base branch
2021-02-17 18:13:15 +01:00
Mislav Marohnić
05421db404 pr status: fix checking branch protection rules on the base branch
Instead of checking branch protection rules on the main branch of the
repository, branch protection rules for a specific PR should be checked
on its base branch, since not all PRs are based on the main branch.

Additionally, do not display "Up to date" if the actual merge status
reported from the server was "UNKNOWN" or "DIRTY", since in those cases
"Up to date" could be false information.
2021-02-17 18:04:49 +01:00
Mislav Marohnić
3b117e6c3c
Merge pull request #2539 from divyaramanathan/issue-create-template
Implementing issue template GraphQL API call
2021-02-17 17:59:42 +01:00
Mislav Marohnić
3a0a8c4e25 Add tests for templateManager 2021-02-17 17:35:04 +01:00
Mislav Marohnić
faa6981f46
Merge pull request #2965 from cli/writeorg-oauth-scope
Recognize the `write:org` OAuth scope as satisfying `read:org`
2021-02-17 17:26:16 +01:00
Mislav Marohnić
4a49e3526c Merge remote-tracking branch 'origin' into writeorg-oauth-scope 2021-02-17 17:11:24 +01:00
Mislav Marohnić
0cd5744398 Un-export HasAPI leaky abstraction 2021-02-17 17:08:50 +01:00
Mislav Marohnić
3a224b7c2a
Merge pull request #2892 from cli/auth-with-ssh
Add SSH key generation & uploading to `gh auth login` flow
2021-02-17 17:07:05 +01:00
Mislav Marohnić
b4bf8cda8d Close pubkey file after reading 2021-02-17 17:01:14 +01:00
Mislav Marohnić
e874236ad6
Merge pull request #2980 from cli/auto-merge
PR merge improvements: auto-merge, edit commit body
2021-02-17 16:58:49 +01:00
Mislav Marohnić
87fcda5fbc Add tests for SSH login flow 2021-02-17 16:52:40 +01:00
Mislav Marohnić
4cd43cc8ef Merge remote-tracking branch 'origin' into auth-with-ssh 2021-02-17 15:29:36 +01:00
Mislav Marohnić
ebc5d01942 Merge remote-tracking branch 'origin' into auto-merge 2021-02-17 15:25:25 +01:00
Mislav Marohnić
203397baf9 Add tests for pr merge --auto/--disable-auto 2021-02-17 15:24:52 +01:00
Mislav Marohnić
ddddd95d73 Allow pr merge --body '' to prevent having the default body applied 2021-02-17 14:38:33 +01:00
Mislav Marohnić
12cf8ef65b Separately query viewerMergeBodyText for GHE compatibility
GHE versions 2.22 and older will not have this GraphQL field. Avoid the
resulting error and have the command proceeed with empty text as the
default.
2021-02-17 14:06:27 +01:00
Mislav Marohnić
2b36b09abf
Update wording for auto-merge confirmation
Co-authored-by: Amanda Pinsker <ampinsk@github.com>
2021-02-17 12:30:04 +01:00
Nate Smith
c2c211dbed
Merge pull request #2952 from redreceipt/up-to-date
Adds Branch Up to Date Status
2021-02-16 12:50:28 -06:00
vilmibm
57140ad35e add header in correct place 2021-02-16 12:25:09 -06:00
Mislav Marohnić
3b650a8c56 Fix typo 2021-02-16 16:28:23 +01:00
Mislav Marohnić
57abe45b96 Let the server choose the commit subject for squashed merge
For single-commit PRs, the commit subject will be the subject of the
head commit and the PR number. For multi-commit PRs, the commit subject
will be the PR title and PR number. Instead of trying to replicate this
logic client-side, omit the `commitHeadline` param and let the server
apply defaults appropriately.

Reverts https://github.com/cli/cli/pull/1627
2021-02-16 16:17:37 +01:00
Mislav Marohnić
67bfedd56b Add pr merge --auto 2021-02-16 16:01:22 +01:00
Cristian Dominguez
f75bd7280f Pre-populate default merge commit message if no body was provided 2021-02-16 16:01:22 +01:00
Sam Coe
4ea8d25b85 Fix tests and polish 2021-02-16 15:59:44 +01:00
Cristian Dominguez
d57cb56945 Allow editing commit msg when squash merging a PR 2021-02-16 15:59:06 +01:00
Mislav Marohnić
0be2033d51 Recognize the write:org OAuth scope as satisfying read:org
If someone pastes a PAT with `write:org` scope, this avoids the error
complaining that the token doesn't have `read:org` permissions. On
GitHub, `write:org` implies `read:org`.
2021-02-15 17:52:41 +01:00
ulwlu
95a8f926ab
Remove unnecessary Sprint 2021-02-13 18:10:38 +09:00
ulwlu
16be90c538
Fix unnecessary Sprintf with Sprint 2021-02-13 17:20:39 +09:00
ulwlu
e461baa217
Fix prompt string when creating remote repository
If you are in git project not pushed to remote yet,
prompt says 'This will create {reponame} in current directory. Continue?',
however, it doesn't create while it only adds remote origin.

I was going to create PR to avoid creating new directory before I knew
this behavior.
This behavior is already ideal, so I changed prompt not to scare users
like I got scared.
2021-02-13 17:11:08 +09:00