Scott Mcdermott
4aff4ebe12
Allow user to override markdown wrap width via $GH_MDWIDTH from environment
2024-10-04 17:43:06 -07:00
Prabhat Kumar Sahu
1886fb46ab
Fix pr checks exit code ( #9452 )
...
* Enhance with exit code documentation
* Add new error message for PR check
* Refine gh pr checks: Add exit code 8
* Update EXIT CODES section format in man page generation
2024-08-16 14:30:11 -07:00
Yukai Chou
d7b8ecf33d
Unify use of tab indent in non-test source files
...
Found with
rg '(^ | \t|\t )' -g '*.go' -g '!*_test.go'
Mixed indent exceptions:
- wrapped long list items with extra 2-space indent
- code snippets using space indent
- commented code lines having "\t*// \t+" prefix
2024-08-03 00:35:30 +08:00
William Martin
c16becc07e
Slightly clarify when CLI will exit with 4
2024-07-23 16:44:49 +02:00
gabemontero
39e4cbd973
update generated content for man pages and website
2024-05-17 09:30:53 -04:00
gabemontero
77f964aa12
williammartin simplifications
2024-05-17 09:30:53 -04:00
gabemontero
c265753275
remove no-op if clause that returns 'No Aliases'
2024-05-17 09:30:53 -04:00
Andy Feller
7dd35e7470
Conditionalize references, remove redundant alias
...
This commit adds conditional logic in `gh reference` to only show aliases if
there are aliases to see. Additionally, this removes the unaliased command
name from being shown under aliases.
2024-05-17 09:30:53 -04:00
gabemontero
dd7ea5adff
list the various alias permutations for the command and subcommands
...
this occurs from either utlizing the help function for a specific command/subcommand
combination or when 'gh reference' lists the command tree
2024-05-17 09:30:53 -04:00
Babak K. Shandiz
9f9d0415da
Output JSON FIELDS
...
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-05-06 17:55:46 +01:00
Meredith Lancaster
90b7bf97c5
gh-attestation cmd integration ( #8698 )
...
* add attestation cmd
Signed-off-by: Meredith Lancaster <malancas@github.com>
* add codeowners
Signed-off-by: Meredith Lancaster <malancas@github.com>
* update args passed to the attestation cmd
Signed-off-by: Meredith Lancaster <malancas@github.com>
* rename file
Signed-off-by: Meredith Lancaster <malancas@github.com>
* use gh-attestation branch for passing iostreams from the root
Signed-off-by: Meredith Lancaster <malancas@github.com>
* add package security team entry to codeowners
Signed-off-by: Meredith Lancaster <malancas@github.com>
* start moving over verify cmd and general verification code
Signed-off-by: Meredith Lancaster <malancas@github.com>
* clean up common and verify specific policy code
Signed-off-by: Meredith Lancaster <malancas@github.com>
* move artifact package over
Signed-off-by: Meredith Lancaster <malancas@github.com>
* start pulling in the github api client wrapper
Signed-off-by: Meredith Lancaster <malancas@github.com>
* fix imports
Signed-off-by: Meredith Lancaster <malancas@github.com>
* add logger and test packages
Signed-off-by: Meredith Lancaster <malancas@github.com>
* add additional packages to support verify command
Signed-off-by: Meredith Lancaster <malancas@github.com>
* fix mock api client
Signed-off-by: Meredith Lancaster <malancas@github.com>
* clean up mock api client
Signed-off-by: Meredith Lancaster <malancas@github.com>
* include missing fields
Signed-off-by: Meredith Lancaster <malancas@github.com>
* use correct owner
Signed-off-by: Meredith Lancaster <malancas@github.com>
* add more mock api client options
Signed-off-by: Meredith Lancaster <malancas@github.com>
* add download cmd
Signed-off-by: Meredith Lancaster <malancas@github.com>
* add inspect cmd
Signed-off-by: Meredith Lancaster <malancas@github.com>
* pass factory object to inspect cmd, add inspect sub cmd to attestation cmd
Signed-off-by: Meredith Lancaster <malancas@github.com>
* add verify-tuf-root cmd
Signed-off-by: Meredith Lancaster <malancas@github.com>
* pass iostream struct from command
Signed-off-by: Meredith Lancaster <malancas@github.com>
* rename logger pkg to logger
Signed-off-by: Meredith Lancaster <malancas@github.com>
* fix path in codeowners
Signed-off-by: Meredith Lancaster <malancas@github.com>
* formatter
Signed-off-by: Meredith Lancaster <malancas@github.com>
* go mod tidy
Signed-off-by: Meredith Lancaster <malancas@github.com>
* fix printf linter issue
Signed-off-by: Meredith Lancaster <malancas@github.com>
* fix printf linter issue
Signed-off-by: Meredith Lancaster <malancas@github.com>
* check user's GH host for compatibility
Signed-off-by: Meredith Lancaster <malancas@github.com>
* pass oci client to commands directly
Signed-off-by: Meredith Lancaster <malancas@github.com>
* rename command
Signed-off-by: Meredith Lancaster <malancas@github.com>
* mark tuf-root-verify cmd hidden
Signed-off-by: Meredith Lancaster <malancas@github.com>
* move client initialization back to subcommands
Signed-off-by: Meredith Lancaster <malancas@github.com>
* add more verbose options and logging
Signed-off-by: Meredith Lancaster <malancas@github.com>
* add missing logger
Signed-off-by: Meredith Lancaster <malancas@github.com>
* add testing around OCI and API client
Signed-off-by: Meredith Lancaster <malancas@github.com>
* add integration test
Signed-off-by: Meredith Lancaster <malancas@github.com>
* fix file path
Signed-off-by: Meredith Lancaster <malancas@github.com>
* fix command
Signed-off-by: Meredith Lancaster <malancas@github.com>
* build executable before integration test
Signed-off-by: Meredith Lancaster <malancas@github.com>
* split integration tests
Signed-off-by: Meredith Lancaster <malancas@github.com>
* remove integration test steps
Signed-off-by: Meredith Lancaster <malancas@github.com>
* fix flag value
Signed-off-by: Meredith Lancaster <malancas@github.com>
* run integration tests on ubuntu for now
Signed-off-by: Meredith Lancaster <malancas@github.com>
* pull over doc updates
Signed-off-by: Meredith Lancaster <malancas@github.com>
* delete unused test data
Signed-off-by: Meredith Lancaster <malancas@github.com>
* remove Go patch version
Signed-off-by: Meredith Lancaster <malancas@github.com>
* switch assert to require
Signed-off-by: Meredith Lancaster <malancas@github.com>
* rename file
Signed-off-by: Meredith Lancaster <malancas@github.com>
* move integration tests to prexisting test workflow
Signed-off-by: Meredith Lancaster <malancas@github.com>
* use platform matrix for integration tests
Signed-off-by: Meredith Lancaster <malancas@github.com>
* simplify build step
Signed-off-by: Meredith Lancaster <malancas@github.com>
* use StringEnumFlag handling
Signed-off-by: Meredith Lancaster <malancas@github.com>
* typo
Signed-off-by: Meredith Lancaster <malancas@github.com>
* use the iostreams.Test helper func
Signed-off-by: Meredith Lancaster <malancas@github.com>
* create interface for oci client
Signed-off-by: Meredith Lancaster <malancas@github.com>
* add tests for oci client
Signed-off-by: Meredith Lancaster <malancas@github.com>
* rename files
Signed-off-by: Meredith Lancaster <malancas@github.com>
* format file
Signed-off-by: Meredith Lancaster <malancas@github.com>
* fix shellcheck issues
Signed-off-by: Meredith Lancaster <malancas@github.com>
* use testing TempDir method
Signed-off-by: Meredith Lancaster <malancas@github.com>
* cleanup unused tempdir handling
Signed-off-by: Meredith Lancaster <malancas@github.com>
* use table driven tests
Signed-off-by: Meredith Lancaster <malancas@github.com>
* check correct cmd
Signed-off-by: Meredith Lancaster <malancas@github.com>
* support repo option in download sub cmd
Signed-off-by: Meredith Lancaster <malancas@github.com>
* switch over to using RunE
Signed-off-by: Meredith Lancaster <malancas@github.com>
* unexport top level subcommand funcs
Signed-off-by: Meredith Lancaster <malancas@github.com>
* add comment around keychain option
Signed-off-by: Meredith Lancaster <malancas@github.com>
* update comments
Signed-off-by: Meredith Lancaster <malancas@github.com>
* fix inconsistent naming
Signed-off-by: Meredith Lancaster <malancas@github.com>
* add tests for CLI commands
Signed-off-by: Meredith Lancaster <malancas@github.com>
* check for noattestationsfound err
Signed-off-by: Meredith Lancaster <malancas@github.com>
* try out metadata abstraction instead
Signed-off-by: Meredith Lancaster <malancas@github.com>
* switch to using MetadataStore abstraction
Signed-off-by: Meredith Lancaster <malancas@github.com>
* include test case with failing metadata store
Signed-off-by: Meredith Lancaster <malancas@github.com>
* look for err specific to file write
Signed-off-by: Meredith Lancaster <malancas@github.com>
* unexport fields
Signed-off-by: Meredith Lancaster <malancas@github.com>
* return err when an unsupported hash alg is provided
Signed-off-by: Meredith Lancaster <malancas@github.com>
* PrintTableToStdOut returns err when rendering fails
Signed-off-by: Meredith Lancaster <malancas@github.com>
* start adding sigstore verifier unit tests
Signed-off-by: Meredith Lancaster <malancas@github.com>
* add more sigstore verifier specific tests
Signed-off-by: Meredith Lancaster <malancas@github.com>
* use cli table printer
Signed-off-by: Meredith Lancaster <malancas@github.com>
* return JSON results in slice instead of table
Signed-off-by: Meredith Lancaster <malancas@github.com>
* move mock client to test file
Signed-off-by: Meredith Lancaster <malancas@github.com>
* remove unneeded table printer method
Signed-off-by: Meredith Lancaster <malancas@github.com>
* add initial tests for tufrootverify cmd
Signed-off-by: Meredith Lancaster <malancas@github.com>
* formatting
Signed-off-by: Meredith Lancaster <malancas@github.com>
* cleanup method
Signed-off-by: Meredith Lancaster <malancas@github.com>
* close file in error handling branch
Signed-off-by: Meredith Lancaster <malancas@github.com>
* normalize artifact path
Signed-off-by: Meredith Lancaster <malancas@github.com>
* remove unneeded embedded file system
Signed-off-by: Meredith Lancaster <malancas@github.com>
* include image name reference err
Signed-off-by: Meredith Lancaster <malancas@github.com>
* use GH_DEBUG value for io handling
Signed-off-by: Meredith Lancaster <malancas@github.com>
* remove quiet and verbose flags
Signed-off-by: Meredith Lancaster <malancas@github.com>
* add more tufrootveriify tests
Signed-off-by: Meredith Lancaster <malancas@github.com>
* GitHubTUFOptions no longer needs to return error
Signed-off-by: Meredith Lancaster <malancas@github.com>
* remove unneeded slice
Signed-off-by: Meredith Lancaster <malancas@github.com>
* normalize all relative paths
Signed-off-by: Meredith Lancaster <malancas@github.com>
* clean up nil client checks
Signed-off-by: Meredith Lancaster <malancas@github.com>
* set api server based on host
Signed-off-by: Meredith Lancaster <malancas@github.com>
* add comment about http client
Signed-off-by: Meredith Lancaster <malancas@github.com>
* use format flag to handle json output in verify cmd
Signed-off-by: Meredith Lancaster <malancas@github.com>
* use format flag to handle json output
Signed-off-by: Meredith Lancaster <malancas@github.com>
* use normalized path for cli test arg
Signed-off-by: Meredith Lancaster <malancas@github.com>
* add tests for json output
Signed-off-by: Meredith Lancaster <malancas@github.com>
* cleanup error wrapping
Signed-off-by: Meredith Lancaster <malancas@github.com>
* use test fixtures correctly by normalizing path
Signed-off-by: Meredith Lancaster <malancas@github.com>
* dont clean
Signed-off-by: Meredith Lancaster <malancas@github.com>
* escape backwards slash for windows files with replace
Signed-off-by: Meredith Lancaster <malancas@github.com>
* use strings.Split func
Signed-off-by: Meredith Lancaster <malancas@github.com>
* use strings.Replace for all command tests
Signed-off-by: Meredith Lancaster <malancas@github.com>
* use CLI cache dir to store tuf metadata
Signed-off-by: Meredith Lancaster <malancas@github.com>
* Tweaked docstrings for gh attestation download
* Tweaked docstrings for gh attestation verify
* Fix for bug in gh attestation where the wrong hostname was being passed to the API client.
* lets hide tuf-root-verify eh?
* Forgot verify's short str.
* add remote verification test
Signed-off-by: Meredith Lancaster <malancas@github.com>
* Revert "add remote verification test"
This reverts commit c0ceb99ca8 .
* update json result handling
Signed-off-by: Meredith Lancaster <malancas@github.com>
* add json tags to struct returned by command
Signed-off-by: Meredith Lancaster <malancas@github.com>
* fix how json results are handled
Signed-off-by: Meredith Lancaster <malancas@github.com>
* add test to ensure JSON output is valid
Signed-off-by: Meredith Lancaster <malancas@github.com>
---------
Signed-off-by: Meredith Lancaster <malancas@github.com>
Co-authored-by: Phill MV <phillmv@github.com>
2024-04-01 11:13:47 -06:00
Andy Feller
c47c1db376
Merge pull request #8367 from Rebeccasun31/show_aliases
...
Documentation for built-in aliases
2024-02-08 14:05:05 -05:00
ihmpavel
72b6dc5d8c
chore: Unify calling gh in examples ( #8560 )
2024-01-11 09:07:23 -08:00
Andy Feller
152ab207b5
For lint sake
2023-12-01 09:20:44 -05:00
Andy Feller
a9e430e9bc
Fix lint warning
2023-12-01 09:16:51 -05:00
Andy Feller
b77de0d458
Additional formatting changes
...
- gh help actions
- highlight 3 commands to run for more information
- gh extension
- wrapping url for online linking
- fix install subcommand missing backtick formatting
- gh release create
- fixing mixed indenting causing usage misalignment
- root help
- backtick wrap help command for more info for consistency
- gh help environment
- backtick wrap missed OWNER/REPO
- gh variable
- brought consistency to output when deleting or setting variable
2023-12-01 09:08:51 -05:00
Yukai Chou
e31919c8fc
Update link to jq docs
2023-11-23 07:20:41 +08:00
Yukai Chou
ba585149c3
Leftovers
2023-11-23 07:12:47 +08:00
Yukai Chou
07a87ca8a4
Wrap special values and placeholders like - and $1
2023-11-23 07:09:29 +08:00
rebeccasun31
6509ba72df
Documentation for built-in aliases
2023-11-23 00:30:13 +08:00
Yukai Chou
21bf1babdf
Proof-reading
2023-11-17 02:04:35 +08:00
Yukai Chou
5c4cb50231
Wrap env variables in backticks uniformly
2023-11-17 01:32:00 +08:00
Yukai Chou
896101678f
Wrap cli commands in backticks uniformly
2023-11-17 01:32:00 +08:00
Lars Lehtonen
07ee387f25
pkg/cmd/root: fix startup panic ( #8105 )
2023-10-02 07:03:24 +00:00
Raj Hawaldar
c5a7bf8f45
Hint adding codespace scope to auth login ( #7961 )
2023-09-21 08:43:27 +02:00
Jun Nishimura
508065b72d
Add verbose flag to api cmd ( #7826 )
2023-08-25 09:37:37 -07:00
John Keech
93e1511bae
Codespaces: Use the host name from the logged in server for commands ( #7795 )
...
* Use the host name from the logged in server for codespace commands
* Fix existing tests
* Add tests for server url configuration
* Rename defaultApiUrl to defaultAPIURL and comment cleanup
* Switch to t.Setenv in codespaces api tests
* Switch to t.Setenv in other tests
* Support custom server in web flows for list and create
* Rename GetServerURL() to ServerURL()
2023-08-08 09:32:06 -07:00
Nate Smith
96d7274044
Merge pull request #7403 from joshkraft/gh-cache-command
...
Create `gh cache list`, `gh cache delete`
2023-07-10 16:00:57 -07:00
Nate Smith
4ba2f2ffb3
Merge pull request #7650 from vaindil/vaindil/rulesets
...
Add support for repository rulesets
2023-07-10 12:50:23 -07:00
whi-tw
a7e2fc49b0
Use SmartBaseRepoFunc for api command ( #7594 )
2023-07-06 15:02:32 +09:00
vilmibm
bcb4194692
WIP compute branch, call API
2023-07-05 13:57:19 -04:00
Sam Coe
9be9dc22e9
Fix error handling for extension and shell alias commands ( #7567 )
2023-06-20 08:41:02 +09:00
Mislav Marohnić
beb6234f96
Speed up listing extensions by lazy-loading extension information when needed ( #7493 )
2023-06-14 09:33:18 +09:00
Ariel Deitcher
ad4a489f8d
Introduce gh project commands ( #7375 )
...
Co-authored-by: Mislav Marohnić <mislav@github.com>
2023-06-09 16:57:01 +00:00
Mislav Marohnić
e3569dc7bd
Fix bash completions for extensions and aliases
...
Now that extensions and alises are real Cobra Command instances, they will appear in
completions automatically and don't need to be additionally inserted via ValidArgs.
Their addition to ValidArgs have caused all extensions and aliases to be listed twice
within completion results, which didn't seem to affect zsh completions at all, but in
bash completions it had caused the completion description to be a part of the expansion.
2023-06-02 13:31:02 +02:00
srz_zumix
dfb6d9d5bb
fix: Allow aliases to recognize extended commands ( #7523 )
2023-06-02 08:20:11 +09:00
Sam Coe
1c3c402377
Do not generate docs for aliases ( #7497 )
2023-05-28 00:27:31 +00:00
Sam Coe
74ee8cacae
Allow creating of nested aliases ( #7457 )
2023-05-25 09:46:45 +09:00
Josh Kraft
2e5a728338
Merge branch 'trunk' into gh-cache-command
2023-05-17 14:34:10 -06:00
Tony F
ae3e879480
Mention setting GH_ENTERPRISE_TOKEN
...
When GH_HOST is set
2023-05-15 10:49:45 -05:00
William Martin
07ed1e4e8a
Introduce helpTopics type and reduce duplication across commands ( #7414 )
2023-05-11 14:59:12 +02:00
Josh Kraft
213a59b8bd
create cache commands
2023-05-03 11:03:50 -06:00
Martijn Pieters
530002ee7a
Pretty-print JSON results of jq filtering ( #7236 )
...
When connected to a TTY, tell the jq formatter to indent the output, and
enable colorization of the output if the terminal supports it.
Co-authored-by: Mislav Marohnić <mislav@github.com>
2023-04-25 13:27:17 +00:00
Josh Kraft
74bf49fcf5
Merge branch 'trunk' into gh-org-command
2023-03-31 15:58:34 -06:00
Josh Kraft
37970f4863
feat: add gh org list
2023-03-31 15:53:55 -06:00
աɨռɢӄաօռɢ
5a2c24d363
docs: revise GH_CONFIG_DIR content in help_topic.go ( #7230 )
2023-03-27 01:18:09 +00:00
Anupam Kumar
88cc4d2531
Add variable set command ( #6928 )
2023-03-13 03:01:38 +00:00
Sam Coe
05bf29d88e
Introduce GH_PATH environment variable ( #7025 )
2023-03-07 11:30:10 +11:00
Sam Coe
c9a2d85793
Cleanup config.AuthToken and config.DefaultHost methods ( #7049 )
2023-02-28 00:24:45 +00:00
Robin Neatherway
78fb90956c
Teach gh cs create to use current repo as default ( #6596 )
...
Co-authored-by: Mislav Marohnić <mislav@github.com>
2023-02-07 20:05:38 +00:00