From 444f9e01e63e580909c7b46843a176147566f3ea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Dec 2025 02:08:18 +0000 Subject: [PATCH] Bump github.com/cli/go-gh/v2 in the go-dependencies group Bumps the go-dependencies group with 1 update: [github.com/cli/go-gh/v2](https://github.com/cli/go-gh). Updates `github.com/cli/go-gh/v2` from 2.12.2 to 2.13.0 - [Release notes](https://github.com/cli/go-gh/releases) - [Commits](https://github.com/cli/go-gh/compare/v2.12.2...v2.13.0) --- updated-dependencies: - dependency-name: github.com/cli/go-gh/v2 dependency-version: 2.13.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: go-dependencies ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- .../cli/go-gh/v2/internal/yamlmap/yaml_map.go | 16 ++++++---------- vendor/github.com/cli/go-gh/v2/pkg/api/errors.go | 6 ++++-- .../cli/go-gh/v2/pkg/api/graphql_client.go | 3 ++- .../cli/go-gh/v2/pkg/api/http_client.go | 3 ++- .../cli/go-gh/v2/pkg/api/rest_client.go | 8 +++++++- .../github.com/cli/go-gh/v2/pkg/config/config.go | 8 ++++++++ .../github.com/cli/go-gh/v2/pkg/config/errors.go | 6 +++--- .../github.com/cli/go-gh/v2/pkg/term/console.go | 1 - .../cli/go-gh/v2/pkg/term/console_windows.go | 1 - vendor/modules.txt | 4 ++-- 12 files changed, 37 insertions(+), 25 deletions(-) diff --git a/go.mod b/go.mod index b8d41aa..f21c649 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.25.1 require github.com/briandowns/spinner v1.23.2 require ( - github.com/cli/go-gh/v2 v2.12.2 + github.com/cli/go-gh/v2 v2.13.0 github.com/cli/shurcooL-graphql v0.0.4 github.com/spf13/cobra v1.10.1 github.com/stretchr/testify v1.11.1 diff --git a/go.sum b/go.sum index 12a5cde..9f1c181 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiE github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8= github.com/briandowns/spinner v1.23.2 h1:Zc6ecUnI+YzLmJniCfDNaMbW0Wid1d5+qcTq4L2FW8w= github.com/briandowns/spinner v1.23.2/go.mod h1:LaZeM4wm2Ywy6vO571mvhQNRcWfRUnXOs0RcKV0wYKM= -github.com/cli/go-gh/v2 v2.12.2 h1:EtocmDAH7dKrH2PscQOQVo7PbFD5G6uYx4rSKY2w1SY= -github.com/cli/go-gh/v2 v2.12.2/go.mod h1:g2IjwHEo27fgItlS9wUbRaXPYurZEXPp1jrxf3piC6g= +github.com/cli/go-gh/v2 v2.13.0 h1:jEHZu/VPVoIJkciK3pzZd3rbT8J90swsK5Ui4ewH1ys= +github.com/cli/go-gh/v2 v2.13.0/go.mod h1:Us/NbQ8VNM0fdaILgoXSz6PKkV5PWaEzkJdc9vR2geM= github.com/cli/safeexec v1.0.1 h1:e/C79PbXF4yYTN/wauC4tviMxEV13BwljGj0N9j+N00= github.com/cli/safeexec v1.0.1/go.mod h1:Z/D4tTN8Vs5gXYHDCbaM1S/anmEDnJb1iW0+EJ5zx3Q= github.com/cli/shurcooL-graphql v0.0.4 h1:6MogPnQJLjKkaXPyGqPRXOI2qCsQdqNfUY1QSJu2GuY= diff --git a/vendor/github.com/cli/go-gh/v2/internal/yamlmap/yaml_map.go b/vendor/github.com/cli/go-gh/v2/internal/yamlmap/yaml_map.go index a440047..b4725d3 100644 --- a/vendor/github.com/cli/go-gh/v2/internal/yamlmap/yaml_map.go +++ b/vendor/github.com/cli/go-gh/v2/internal/yamlmap/yaml_map.go @@ -149,6 +149,8 @@ func (m *Map) SetEntry(key string, value *Map) { m.AddEntry(key, value) } +// SetModified marks the map as modified. +// // Note: This is a hack to introduce the concept of modified/unmodified // on top of gopkg.in/yaml.v3. This works by setting the Value property // of a MappingNode to a specific value and then later checking if the @@ -166,14 +168,11 @@ func (m *Map) SetModified() { } } -// Traverse map using BFS to set all nodes as unmodified. +// SetUnmodified traverses the map using BFS to set all nodes as unmodified. func (m *Map) SetUnmodified() { i := 0 queue := []*yaml.Node{m.Node} - for { - if i > (len(queue) - 1) { - break - } + for i < len(queue) { q := queue[i] i = i + 1 if q.Kind != yaml.MappingNode { @@ -184,14 +183,11 @@ func (m *Map) SetUnmodified() { } } -// Traverse map using BFS to searach for any nodes that have been modified. +// IsModified traverses the map using BFS to search for any nodes that have been modified. func (m *Map) IsModified() bool { i := 0 queue := []*yaml.Node{m.Node} - for { - if i > (len(queue) - 1) { - break - } + for i < len(queue) { q := queue[i] i = i + 1 if q.Kind != yaml.MappingNode { diff --git a/vendor/github.com/cli/go-gh/v2/pkg/api/errors.go b/vendor/github.com/cli/go-gh/v2/pkg/api/errors.go index e8fb93f..74e9515 100644 --- a/vendor/github.com/cli/go-gh/v2/pkg/api/errors.go +++ b/vendor/github.com/cli/go-gh/v2/pkg/api/errors.go @@ -27,7 +27,7 @@ type HTTPErrorItem struct { Resource string } -// Allow HTTPError to satisfy error interface. +// Error allows HTTPError to satisfy error interface. func (err *HTTPError) Error() string { if msgs := strings.SplitN(err.Message, "\n", 2); len(msgs) > 1 { return fmt.Sprintf("HTTP %d: %s (%s)\n%s", err.StatusCode, msgs[0], err.RequestURL, msgs[1]) @@ -55,7 +55,7 @@ type GraphQLErrorItem struct { Type string } -// Allow GraphQLError to satisfy error interface. +// Error allows GraphQLError to satisfy error interface. func (gr *GraphQLError) Error() string { errorMessages := make([]string, 0, len(gr.Errors)) for _, e := range gr.Errors { @@ -98,6 +98,8 @@ func matchPath(p, expect string) bool { } // HandleHTTPError parses a http.Response into a HTTPError. +// +// The function attempts to read the response's body, but it does not close it. func HandleHTTPError(resp *http.Response) error { httpError := &HTTPError{ Headers: resp.Header, diff --git a/vendor/github.com/cli/go-gh/v2/pkg/api/graphql_client.go b/vendor/github.com/cli/go-gh/v2/pkg/api/graphql_client.go index 3317eef..a985f70 100644 --- a/vendor/github.com/cli/go-gh/v2/pkg/api/graphql_client.go +++ b/vendor/github.com/cli/go-gh/v2/pkg/api/graphql_client.go @@ -26,7 +26,8 @@ func DefaultGraphQLClient() (*GraphQLClient, error) { return NewGraphQLClient(ClientOptions{}) } -// GraphQLClient builds a client to send requests to GitHub GraphQL API endpoints. +// NewGraphQLClient builds a client to send requests to GitHub GraphQL API endpoints. +// // As part of the configuration a hostname, auth token, default set of headers, // and unix domain socket are resolved from the gh environment configuration. // These behaviors can be overridden using the opts argument. diff --git a/vendor/github.com/cli/go-gh/v2/pkg/api/http_client.go b/vendor/github.com/cli/go-gh/v2/pkg/api/http_client.go index 1d7c517..2195306 100644 --- a/vendor/github.com/cli/go-gh/v2/pkg/api/http_client.go +++ b/vendor/github.com/cli/go-gh/v2/pkg/api/http_client.go @@ -37,7 +37,8 @@ func DefaultHTTPClient() (*http.Client, error) { return NewHTTPClient(ClientOptions{}) } -// HTTPClient builds a client that can be passed to another library. +// NewHTTPClient builds a client that can be passed to another library. +// // As part of the configuration a hostname, auth token, default set of headers, // and unix domain socket are resolved from the gh environment configuration. // These behaviors can be overridden using the opts argument. In this instance diff --git a/vendor/github.com/cli/go-gh/v2/pkg/api/rest_client.go b/vendor/github.com/cli/go-gh/v2/pkg/api/rest_client.go index ccd86cd..097e637 100644 --- a/vendor/github.com/cli/go-gh/v2/pkg/api/rest_client.go +++ b/vendor/github.com/cli/go-gh/v2/pkg/api/rest_client.go @@ -22,7 +22,8 @@ func DefaultRESTClient() (*RESTClient, error) { return NewRESTClient(ClientOptions{}) } -// RESTClient builds a client to send requests to GitHub REST API endpoints. +// NewRESTClient builds a client to send requests to GitHub REST API endpoints. +// // As part of the configuration a hostname, auth token, default set of headers, // and unix domain socket are resolved from the gh environment configuration. // These behaviors can be overridden using the opts argument. @@ -100,6 +101,11 @@ func (c *RESTClient) DoWithContext(ctx context.Context, method string, path stri if resp.StatusCode == http.StatusNoContent { return nil } + + if resp.StatusCode == http.StatusResetContent { + return nil + } + defer resp.Body.Close() b, err := io.ReadAll(resp.Body) diff --git a/vendor/github.com/cli/go-gh/v2/pkg/config/config.go b/vendor/github.com/cli/go-gh/v2/pkg/config/config.go index 0de46fe..9789a06 100644 --- a/vendor/github.com/cli/go-gh/v2/pkg/config/config.go +++ b/vendor/github.com/cli/go-gh/v2/pkg/config/config.go @@ -244,6 +244,8 @@ func mapFromString(str string) (*yamlmap.Map, error) { return yamlmap.Unmarshal([]byte(str)) } +// ConfigDir returns the path to the configuration directory. +// // Config path precedence: GH_CONFIG_DIR, XDG_CONFIG_HOME, AppData (windows only), HOME. func ConfigDir() string { var path string @@ -260,6 +262,8 @@ func ConfigDir() string { return path } +// StateDir returns the path to the state directory. +// // State path precedence: XDG_STATE_HOME, LocalAppData (windows only), HOME. func StateDir() string { var path string @@ -274,6 +278,8 @@ func StateDir() string { return path } +// DataDir returns the path to the data directory. +// // Data path precedence: XDG_DATA_HOME, LocalAppData (windows only), HOME. func DataDir() string { var path string @@ -288,6 +294,8 @@ func DataDir() string { return path } +// CacheDir returns the path to the cache directory. +// // Cache path precedence: XDG_CACHE_HOME, LocalAppData (windows only), HOME, legacy gh-cli-cache. func CacheDir() string { if a := os.Getenv(xdgCacheHome); a != "" { diff --git a/vendor/github.com/cli/go-gh/v2/pkg/config/errors.go b/vendor/github.com/cli/go-gh/v2/pkg/config/errors.go index 1aefd19..f30e9c9 100644 --- a/vendor/github.com/cli/go-gh/v2/pkg/config/errors.go +++ b/vendor/github.com/cli/go-gh/v2/pkg/config/errors.go @@ -10,12 +10,12 @@ type InvalidConfigFileError struct { Err error } -// Allow InvalidConfigFileError to satisfy error interface. +// Error allows InvalidConfigFileError to satisfy error interface. func (e *InvalidConfigFileError) Error() string { return fmt.Sprintf("invalid config file %s: %s", e.Path, e.Err) } -// Allow InvalidConfigFileError to be unwrapped. +// Unwrap allows InvalidConfigFileError to be unwrapped. func (e *InvalidConfigFileError) Unwrap() error { return e.Err } @@ -26,7 +26,7 @@ type KeyNotFoundError struct { Key string } -// Allow KeyNotFoundError to satisfy error interface. +// Error allows KeyNotFoundError to satisfy error interface. func (e *KeyNotFoundError) Error() string { return fmt.Sprintf("could not find key %q", e.Key) } diff --git a/vendor/github.com/cli/go-gh/v2/pkg/term/console.go b/vendor/github.com/cli/go-gh/v2/pkg/term/console.go index 4ff7e95..995df14 100644 --- a/vendor/github.com/cli/go-gh/v2/pkg/term/console.go +++ b/vendor/github.com/cli/go-gh/v2/pkg/term/console.go @@ -1,5 +1,4 @@ //go:build !windows -// +build !windows package term diff --git a/vendor/github.com/cli/go-gh/v2/pkg/term/console_windows.go b/vendor/github.com/cli/go-gh/v2/pkg/term/console_windows.go index 55b1e42..ae5ad49 100644 --- a/vendor/github.com/cli/go-gh/v2/pkg/term/console_windows.go +++ b/vendor/github.com/cli/go-gh/v2/pkg/term/console_windows.go @@ -1,5 +1,4 @@ //go:build windows -// +build windows package term diff --git a/vendor/modules.txt b/vendor/modules.txt index 29e9691..1dfcf14 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -4,8 +4,8 @@ github.com/aymanbagabas/go-osc52/v2 # github.com/briandowns/spinner v1.23.2 ## explicit; go 1.17 github.com/briandowns/spinner -# github.com/cli/go-gh/v2 v2.12.2 -## explicit; go 1.23.0 +# github.com/cli/go-gh/v2 v2.13.0 +## explicit; go 1.25.0 github.com/cli/go-gh/v2/internal/set github.com/cli/go-gh/v2/internal/yamlmap github.com/cli/go-gh/v2/pkg/api