Commit graph

5052 commits

Author SHA1 Message Date
Benjamin Chadwick
4bbbf46321
Fix browse last commit when using the repo override flag (#4845) 2021-12-13 15:00:22 +01:00
Mislav Marohnić
2d0b9460be
Merge pull request #4318 from g14a/gh-repo-edit
gh repo edit
2021-12-10 13:44:39 +01:00
Mislav Marohnić
c509a3d4e6
Merge pull request #4861 from despreston/4835-labels-race
fix race condition when updating labels
2021-12-08 16:25:00 +01:00
Mislav Marohnić
db50b54513 Simplify GraphQL mutations whose response we are not interested in 2021-12-08 13:35:19 +01:00
Des Preston
886f5e0e78 Avoid race condition when updating labels
Update labels using the `addLabelsToLabelable` and
`removeLabelsFromLabelable` mutations instead of via the `updateIssue`
mutation that replaces the entire set of labels. This prevents the edit
operation from clobbering any unseen changes to the list of labels.

Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-12-08 13:29:47 +01:00
Sergio Guzmán Mayorga
43ae0e5f87
Add interactive tag selector to create release (#4525) 2021-12-08 16:20:15 +04:00
Tomohiro Nishimura
a9d397be69
Add --generate-notes flag to gh release create command. (#4467) 2021-12-08 15:20:59 +04:00
Mislav Marohnić
29816b63c3
Merge pull request #4862 from cli/api-err-409
api: handle HTTP 409 error message from the server
2021-12-07 19:37:19 +01:00
Mislav Marohnić
7d199fa783 repo edit: add ability to add or remove repository topics 2021-12-07 19:28:29 +01:00
Gowtham Munukutla
98217fc38c gh repo edit
Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-12-07 19:28:29 +01:00
Mislav Marohnić
ead6bf87d9 api: handle HTTP 409 error message from the server
Previously, "errors" field was either an array of strings or an array of
error objects. This covers an additional case when "errors" is a string:

    $ gh api orgs/cli/actions/permissions/repositories
    {
      "message": "Conflict",
      "errors": "Actions are enabled for all repositories",
      "documentation_url": "https://docs.github.com/rest/reference/actions#list-selected-repositories-enabled-for-github-actions-in-an-organization"
    }
2021-12-06 19:54:54 +01:00
Mislav Marohnić
0e3c3bb4a4
pr view: ensure that PR reviews are always rendered in --comments mode (#4848)
The GraphQL query for review didn't use to request the `TotalCount`
field, but that field was checked before rendering the conversation
thread in `pr view --comments`. This fixes rendering the conversation
thread when a PR only has reviews but no ordinary comments.
2021-12-03 18:07:27 +01:00
Mislav Marohnić
4a476bb400
Merge pull request #4847 from rsteube/fix-shorthand
gist view: fix missing files shorthand
2021-12-03 11:23:30 +01:00
rsteube
24c41b5e88 gist view: fix missing files shorthand
converted to `BoolVar`
2021-12-03 10:45:33 +01:00
Alan Donovan
0052199a4c
Merge pull request #4842 from cli/gh-cs-cp-help-typo
gh cs cp --help: fix typo
2021-12-02 23:44:25 -05:00
Alan Donovan
5fea604f78
gh cs cp --help: fix typo 2021-12-02 17:09:20 -05:00
Des Preston
94a640bd2a
Add auth setup-git for setting up gh as a git credential helper (#4246)
Adds a new command `gh auth setup-git [<hostname>]` that sets up git to
use the GitHub CLI as a credential helper.

The gist is that it runs these two git commands for each hostname the
user is authenticated with.

```
git config --global --replace-all 'credential.https://github.com.helper' ''
git config --global --add 'credential.https://github.com.helper' '!gh auth git-credential'
```

If a hostname flag is given, it'll setup GH CLI as a credential helper
for only that hostname.

If the user is not authenticated with any git hostnames, or the user is
not authenticated with the hostname given as a flag, it'll print an
error.

Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-12-02 16:38:34 +00:00
Nate Smith
a056fbf0cb
Merge pull request #4838 from cli/go-1.17-fmt
Generate Go 1.17-style `go:build` directives
2021-12-02 10:24:56 -06:00
Sergio Guzmán Mayorga
f13f0e7d87
Add secret set --no-store to print the encrypted secret (#4423)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-12-02 16:05:10 +00:00
Mislav Marohnić
d02f184bd1 go fmt 2021-12-02 16:12:24 +01:00
Nate Smith
7e7735d450
Merge pull request #4729 from cli/config-list
Add `gh config list`
2021-12-01 17:34:59 -06:00
Des Preston
8f9548fd37
Ignore scope suggestions for http 422 (#4809)
HTTP 422 messages are for validation errors, but OAUTH permissions
suggestions get printed anyways. Most times, the user probably has the
right permissions. This fix adds the check to avoid printing a confusing
message.

Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-12-01 18:13:48 +00:00
Nate Smith
6906dea671
Merge pull request #4833 from cli/diff-color
pr diff color output fixes
2021-12-01 10:48:31 -06:00
Mislav Marohnić
c33eb3bee1 pr diff: support very long lines 2021-12-01 17:03:11 +01:00
Mislav Marohnić
4a6aa0e938 pr diff: respect global NO_COLOR/CLICOLOR_FORCE settings
In the absence of an explicit `--color` setting, or when `--color=auto`
is passed, the pr diff command should fall back to respecting the global
colorization setting as inferred from the environment.
2021-12-01 17:03:11 +01:00
Mislav Marohnić
c6821b6dde
Merge pull request #4832 from cli/dependabot/go_modules/github.com/itchyny/gojq-0.12.6
Bump github.com/itchyny/gojq from 0.12.5 to 0.12.6
2021-12-01 15:41:12 +01:00
dependabot[bot]
eda0847ec6
Bump github.com/itchyny/gojq from 0.12.5 to 0.12.6
Bumps [github.com/itchyny/gojq](https://github.com/itchyny/gojq) from 0.12.5 to 0.12.6.
- [Release notes](https://github.com/itchyny/gojq/releases)
- [Changelog](https://github.com/itchyny/gojq/blob/main/CHANGELOG.md)
- [Commits](https://github.com/itchyny/gojq/compare/v0.12.5...v0.12.6)

---
updated-dependencies:
- dependency-name: github.com/itchyny/gojq
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-01 14:29:52 +00:00
Nate Smith
59082a1fde
Merge pull request #4802 from cli/mislav/bin-ext-create
Extensions create 💅
2021-11-30 16:36:24 -06:00
Nate Smith
56faf17b06
Merge pull request #4718 from cli/bin-ext-create
make extension create binary aware
2021-11-30 16:36:00 -06:00
Mislav Marohnić
14f704fd0d
Merge pull request #4489 from lpessoa/lp-2167
Adding gh release download for .zip and .tar.gz
2021-11-30 16:01:17 +01:00
Mislav Marohnić
acc1759434 Allow downloading the archive of the latest release 2021-11-30 15:52:51 +01:00
Mislav Marohnić
8e311847db Ensure that we never download "legacy" archive formats
The `zipball_url` and `tarball_url` fields on the Release API payload
always link to "legacy" archives that are of a different format than
those one would get if they downloaded an archive from a Release using
the web interface. The GitHub API does not seem to publish links to
non-legacy archives.

This adds a redirect hack to turn "legacy" Codeload URLs into non-legacy
ones with the goal of ensuring the consistency of user experience when
downloading archives.
2021-11-30 15:52:51 +01:00
lpessoa
8058c4ea34 Adding gh release download for .zip and .tar.gz
Co-authored-by: Mislav Marohnić <mislav@github.com>
2021-11-30 15:52:51 +01:00
Parth
c987c5711d
pr merge: pull after switching branches (#4748) 2021-11-29 18:26:35 +01:00
Nate Smith
31010f88d1
Merge pull request #4810 from cli/some-automation
some automation
2021-11-29 11:23:39 -06:00
Mislav Marohnić
323e53ebe3
Merge pull request #4803 from cli/issue-view-resilient
Improve `issue view` re: overfetching, PR support
2021-11-29 17:08:22 +01:00
Des Preston
bdd95e11ab
Don't swallow duplicate key error (#4807) 2021-11-25 13:22:42 +01:00
nate smith
9b1be750d2 oops 2021-11-24 16:45:27 -06:00
nate smith
1ba03938a1 automatically label non-core issues 2021-11-24 16:32:07 -06:00
nate smith
9326824e9e self-assign core team PRs 2021-11-24 16:31:17 -06:00
nate smith
0e52f429c0 label external PRs as such 2021-11-24 16:30:31 -06:00
Mislav Marohnić
34fc5fb75c Improve issue view re: overfetching, PR support
- Supports passing a PR as argument, not just issues
- Makes it non-fatal when project cards were not able to load
- Cleans up legacy method for fetching issues
2021-11-24 18:49:36 +01:00
Mislav Marohnić
a573eb5d80
Fix codespace code command under WSL (#4747)
The `codespace code` command used the `skratchdot/open-golang` library
to open `vscode://` URLs, which uses `xdg-open` for Linux under the
hood, which isn't available under WSL.

This switches over to using the `cli/browser` package which has explicit
support for WSL by invoking `wslview` when found.
2021-11-24 16:18:24 +00:00
Sam
0bc47fded5
Merge pull request #4784 from cli/config-map-fixes
Fix up bug in RemoveEntry and add tests for config_map
2021-11-24 08:17:40 -08:00
Parth
39bd9aafdc
pr merge: allow deleting remote branch if local branch does not exist (#4769) 2021-11-24 16:50:25 +01:00
Mislav Marohnić
4866bec849
Merge pull request #4804 from cli/dependabot/go_modules/github.com/mattn/go-colorable-0.1.12
Bump github.com/mattn/go-colorable from 0.1.11 to 0.1.12
2021-11-24 15:41:51 +01:00
dependabot[bot]
efcbfb42bf
Bump github.com/mattn/go-colorable from 0.1.11 to 0.1.12
Bumps [github.com/mattn/go-colorable](https://github.com/mattn/go-colorable) from 0.1.11 to 0.1.12.
- [Release notes](https://github.com/mattn/go-colorable/releases)
- [Commits](https://github.com/mattn/go-colorable/compare/v0.1.11...v0.1.12)

---
updated-dependencies:
- dependency-name: github.com/mattn/go-colorable
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-24 14:26:33 +00:00
Mislav Marohnić
5efc0c825f
Merge pull request #4794 from cli/issue-no-overfetch
Improve queries in `issue` commands: no overfetching, support PR arguments
2021-11-24 14:48:48 +01:00
Mislav Marohnić
a65b9a3831 💅 simplify filesystem operations while creating extensions
- doing mkdir before `git init <dir>` is not necessary; git will
  create the directory if it doesn't exist
- passing both `-C` and `--git-dir` is not needed for git invocations
- reading the current working directory isn't necessary for specifying
  nested paths to operate in
- use `git add .` instead of explicitly naming all paths; we generate a
  gitignore for binaries that we want to avoid adding
- generate cross-platform gitignore for Go binary extensions
- add helpers to simplify writing files, tests
2021-11-24 13:46:36 +01:00
Mislav Marohnić
e506910a08 Add newlines to generated files 2021-11-24 11:59:00 +01:00