Commit graph

29 commits

Author SHA1 Message Date
ferhat elmas
70470f9cef refactor: drop multierror in favor of std
Drop github.com/hashicorp/go-multierror
in favor of https://pkg.go.dev/errors#Join (go1.20).

Related to #11468

Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
2025-12-02 15:08:58 +01:00
Andy Feller
000b2f95e0
Merge branch 'trunk' into tab-indents 2024-08-06 13:08:48 -04:00
Andy Feller
c088951944 Fix host handling in variable and secret delete
This change updates `gh variable delete` and `gh secret delete` to use the host associated with the repository rather than the default host.  Along with these changes is minor refactoring of the tests to ensure appropriate Dotcom vs GHES targeting works as expected.

Minor edit to `gh variable get` testing to simplify some conditional logic in test setup.
2024-08-02 15:11:22 -04: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
Andy Feller
22a5a4c899 Update gh variable get to use repo host
Closes #9274

This change addresses a bug where repository and repository environment variables are not being retrieved from the appropriate host, causing GHES users to fail without specifying `GH_HOST` to force `gh variable set` to do the right thing.

In addition, the tests for this command have been updated to check both github.com and GHES variations to ensure this works.
2024-08-02 10:36:32 -04:00
William Martin
d4e33858ef Fetch variable selected repo relationship when required 2024-06-25 17:11:56 +02:00
Babak K. Shandiz
4aa6f8f2f3
Add createdAt field to tests
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-05-26 00:06:25 +01:00
Babak K. Shandiz
94dff4de04
Add createdAt field to Variable type
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-05-26 00:05:04 +01:00
Babak K. Shandiz
43e3e9410e
Add test for exporting as JSON
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-05-25 23:56:37 +01:00
Babak K. Shandiz
7add5a47bd
Add test for JSON output
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-05-25 23:56:36 +01:00
Babak K. Shandiz
840ddc5df5
Only populate selected repo information for JSON output
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-05-25 23:56:36 +01:00
Babak K. Shandiz
ab85baaab4
Add test to verify JSON exporter gets set
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-05-25 23:56:35 +01:00
Babak K. Shandiz
96549077cc
Add --json option support
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-05-25 23:56:35 +01:00
Babak K. Shandiz
9d8b783304
Use Variable type defined in shared package
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-05-25 23:56:35 +01:00
Babak K. Shandiz
2a5a4ce162
Add tests for JSON output
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-05-25 23:56:34 +01:00
Babak K. Shandiz
d8219426ba
Move Variable type and PopulateSelectedRepositoryInformation func to shared
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
2024-05-25 23:56:34 +01:00
Arne Jørgensen
08a5589abe
Add a gh variable get FOO command (#9106)
Closes #9103.

---------

Co-authored-by: William Martin <williammartin@github.com>
2024-05-23 17:11:53 +02:00
William Martin
1d38230675
Move config interfaces into gh package (#9060) 2024-05-10 10:39:36 +02:00
Dean Tate
a3601a7eca bug: fixed the result.Operation variable prior to patchRepoVariable being called in the setVariable function. 2024-02-18 11:12:01 +11:00
w1mvy
9dd5805f9c
Add json export flags to variable list command (#8516) 2024-01-17 10:09:09 -08: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
1ac1609bb7 Use "GitHub Actions" as a whole 2023-11-23 07:20:11 +08:00
Yukai Chou
896101678f Wrap cli commands in backticks uniformly 2023-11-17 01:32:00 +08:00
Heath Stewart
7738b6187c
Add headers to all tables (#8157) 2023-10-20 11:20:02 +02:00
rsteube
1fc98f6808
variable: fix listing and deleting variables in an environment (#7207)
Co-authored-by: Mislav Marohnić <mislav@github.com>
2023-03-21 11:46:50 +00:00
Sam Coe
41a457136e
Tech debt cleanup for variable and secret commands (#7151) 2023-03-15 01:03:56 +00:00
Anupam Kumar
e5a0b1fe34
Add variable delete command (#6929) 2023-03-13 03:41:55 +00:00
Anupam Kumar
c82509587e
Add variable list command (#6995) 2023-03-13 03:21:21 +00:00
Anupam Kumar
88cc4d2531
Add variable set command (#6928) 2023-03-13 03:01:38 +00:00