Commit graph

5685 commits

Author SHA1 Message Date
Tyler McGoffin
b56353dc02
Disallow use of --include-content without --filter 2024-10-12 23:17:55 -07:00
Heath Stewart
73af9f8bd9
Improve help docs
Also changes `--filter` argument to "expression" to coincide with some other commands' help text e.g., `--jq`.
2024-10-12 23:17:55 -07:00
Heath Stewart
34203d7e6c
Refactor filtering into existing gist list
Resolves feedback in issue #9704
2024-10-12 23:17:55 -07:00
Heath Stewart
2fb5687777
Improve performance
Filter as we get results instead of getting them all. This allows us to more easily terminate pagination when opts.Limit is reached.
2024-10-12 23:17:55 -07:00
Heath Stewart
8c6d4c9c52
Add gist search command
Resolves #9704
2024-10-12 23:17:52 -07:00
bagtoad
291370824b Return nil instead of empty objects when err 2024-10-11 12:08:10 -06:00
bagtoad
b6cdbc9e22 Fix license list and view tests 2024-10-11 11:59:06 -06:00
Kynan Ware
c6c938fafe
Apply suggestions from code review
Co-authored-by: Andy Feller <andyfeller@github.com>
2024-10-11 09:53:33 -06:00
Phill MV
28c2308458 While we're at it, let's ensure VerifyCertExtensions can't be tricked the same way. 2024-10-10 11:22:22 -04:00
bagtoad
9b0fc5d555 Merge branch 'bagtoad/cli-8946-list-licenses-and-gitignore-options' of https://github.com/cli/cli into bagtoad/cli-8946-list-licenses-and-gitignore-options 2024-10-09 22:51:38 -06:00
bagtoad
95ca152fea Add examples for creating .gitignore files 2024-10-09 22:51:24 -06:00
Kynan Ware
d45777651d
Merge branch 'trunk' into bagtoad/cli-8946-list-licenses-and-gitignore-options 2024-10-09 22:42:29 -06:00
bagtoad
922a157206 Update help for license view
Updated `Use` to indicate that args can be an SPDX ID or license key.
Improved the examples docs to show the use of both.
2024-10-09 22:34:06 -06:00
bagtoad
9b94bee895 Refactor http error handling 2024-10-09 22:26:03 -06:00
bagtoad
8abed17a00 implement --web flag for license view 2024-10-09 22:21:26 -06:00
bagtoad
a42d3e2f79 Fix license view help doc, add LICENSE.md example 2024-10-09 21:46:41 -06:00
bagtoad
f07f49810a Update help and fix heredoc indentation 2024-10-09 21:41:54 -06:00
bagtoad
282b3293c5 Add SPDX ID to license list output 2024-10-09 21:21:13 -06:00
bagtoad
d6c6c6b40c Fix ExactArgs invocation 2024-10-09 21:15:16 -06:00
bagtoad
f064bda5ea Add Long for license list indicating limitations 2024-10-09 21:10:35 -06:00
bagtoad
4ecb125c7c Update function names
Licenses are no longer referred to as templates. Prefix the new license and gitignore functions with "Repo" as a more descriptive name.
2024-10-09 21:00:43 -06:00
bagtoad
c2a7756c01 Reverse repo/shared package name change 2024-10-09 20:49:29 -06:00
Phill MV
aaea0166e2 If provided with zero attestations to verify, the LiveSigstoreVerifier.Verify func should return an error. 2024-10-09 16:51:00 -04:00
Tyler McGoffin
dcbd1b728c Add test coverage for TitleSurvey change 2024-10-08 16:32:50 -07:00
Tyler McGoffin
da945314fd Fix failing test for pr and issue create 2024-10-08 16:11:05 -07:00
Tyler McGoffin
be3b6cbd8d Make the X in the error message red and print with io writer 2024-10-08 16:03:14 -07:00
Kynan Ware
8a1e6ac9f0
Apply suggestions from code review
Co-authored-by: Andy Feller <andyfeller@github.com>
2024-10-08 14:00:30 -06:00
Kynan Ware
04ed1ed1a0
Merge branch 'trunk' into bagtoad/cli-8946-list-licenses-and-gitignore-options 2024-10-06 14:01:58 -06:00
bagtoad
3be44fb6e2 Move API calls to queries_repo.go 2024-10-06 11:51:16 -06:00
Scott Mcdermott
4aff4ebe12 Allow user to override markdown wrap width via $GH_MDWIDTH from environment 2024-10-04 17:43:06 -07:00
Tyler McGoffin
5fc311374a Add handling of empty titles for Issues and PRs
Currently, the prompter doesn't enforce the requirement of a title for PR
and Issue creation. However, that creates the UX where a user can enter a
blank title, spend time filling out a detailed body, then fail to create
the issue or pr when the request is sent to the api because the title is
blank. This attempts to handle that before sending a request to the api,
enforcing that, when prompting, the title of an issue is not blank.
2024-10-04 10:08:48 -07:00
Tyler McGoffin
9bd75d23ee
Merge pull request #9650 from timrogers/timrogers/log-platform-fallback
Emit a log message when extension installation falls back to a `darwin-amd64` binary on an Apple Silicon macOS device
2024-10-03 10:19:14 -07:00
bagtoad
0bc0f8c8eb Implement license view 2024-09-29 19:09:46 -06:00
bagtoad
c76acb6aff Implement gitignore view 2024-09-29 17:26:04 -06:00
bagtoad
038b57c866 implement gitignore list 2024-09-29 12:29:56 -06:00
bagtoad
25cdce2cec Update license table headings and tests 2024-09-29 11:59:15 -06:00
bagtoad
2b4464a3af Fix ListLicenseTemplates doc 2024-09-29 11:49:09 -06:00
bagtoad
ac779ba82a fix output capitalization 2024-09-29 11:48:48 -06:00
bagtoad
2f608e3772 Cleanup rendering and tests 2024-09-29 11:46:37 -06:00
bagtoad
1aa2a824ba Remove json output option
Because the API query uses REST, the JSON exporter doesn't work as expected.
2024-09-29 11:00:29 -06:00
bagtoad
21f0d9466e Divide shared repo package and add queries tests 2024-09-29 10:40:22 -06:00
bagtoad
fd8c4633e3 First pass at implementing gh repo license list 2024-09-23 12:30:02 -06:00
Tyler McGoffin
9f3f91f80a
Merge pull request #9642 from cli/jtmcg/503
Replace "GitHub Enterprise Server" option with "other" in gh auth login prompting
2024-09-23 10:50:36 -07:00
Tyler McGoffin
f4af65d9df Update docs language to remove possible confusion around 'where you log in' 2024-09-23 09:35:57 -07:00
Tyler McGoffin
029dc8ffc1 Change conditional in promptForHostname to better reflect prompter changes
The old isEnterprise check no longer makes sense, given the prompter is
providing 'other', not 'GitHub Enterprise Server' as its non-GitHub.com
option. Additionally, there was an opportunity for cleaning up the code
via early returns and the removal of the default hostname lookup if we
don't need it.
2024-09-23 09:04:03 -07:00
Tim Rogers
1eda1b41a7
Emit a log message when extension installation falls back to a darwin-amd64 binary on an Apple Silicon macOS machine 2024-09-21 14:56:43 -05:00
Tyler McGoffin
ccb830ca36 Shorten language on Authenticate with a GitHub host.
The default authentication mode is a web-based browser flow. After completion, an
authentication token will be stored securely in the system credential store.
If a credential store is not found or there is an issue using it gh will fallback
to writing the token to a plain text file. See `gh auth status` for its
stored location.

Alternatively, use `--with-token` to pass in a token on standard input.
The minimum required scopes for the token are: `repo`, `read:org`, and `gist`.

Alternatively, gh will use the authentication token found in environment variables.
This method is most suitable for "headless" use of gh such as in automation. See
`gh help environment` for more info.

To use gh in GitHub Actions, add `GH_TOKEN: ${{ github.token }}` to `env`.

The git protocol to use for git operations on this host can be set with `--git-protocol`,
or during the interactive prompting. Although login is for a single account on a host, setting
the git protocol will take effect for all users on the host.

Specifying `ssh` for the git protocol will detect existing SSH keys to upload,
prompting to create and upload a new key if one is not found. This can be skipped with
`--skip-ssh-key` flag.

USAGE
  gh auth login [flags]

FLAGS
  -p, --git-protocol string   The protocol to use for git operations on this host: {ssh|https}
  -h, --hostname string       The hostname of the GitHub instance to authenticate with
      --insecure-storage      Save authentication credentials in plain text instead of credential store
  -s, --scopes strings        Additional authentication scopes to request
      --skip-ssh-key          Skip generate/upload SSH key prompt
  -w, --web                   Open a browser to authenticate
      --with-token            Read token from standard input

INHERITED FLAGS
  --help   Show help for command

EXAMPLES
  # Start interactive setup
  $ gh auth login

  # Authenticate against github.com by reading the token from a file
  $ gh auth login --with-token < mytoken.txt

  # Authenticate with specific host
  $ gh auth login --hostname enterprise.internal

LEARN MORE
  Use `gh <command> <subcommand> --help` for more information about a command.
  Read the manual at https://cli.github.com/manual
  Learn about exit codes using `gh help exit-codes` around Tylers-GitHub-MacBook.local
2024-09-20 15:51:07 -07:00
Tyler McGoffin
2059c630a2 Update language on docstring for gh auth login 2024-09-20 14:12:13 -07:00
Tyler McGoffin
13e916bcfb Change prompts for gh auth login to reflect change from GHE to Other 2024-09-20 14:10:05 -07:00
Tyler McGoffin
bc587f6576 Sentence case 'Other' option in hostname prompt 2024-09-20 13:55:20 -07:00