Skip to content

Commit b86894e

Browse files
committed
Remove go-gh v1.2.1 from main as well
1 parent d8402b1 commit b86894e

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ go 1.21
55
toolchain go1.23.1
66

77
require (
8-
github.com/cli/go-gh v1.2.1
98
github.com/cli/go-gh/v2 v2.10.0
109
github.com/cli/shurcooL-graphql v0.0.4
1110
github.com/spf13/pflag v1.0.5

go.sum

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ
22
github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE=
33
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
44
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
5-
github.com/cli/go-gh v1.2.1 h1:xFrjejSsgPiwXFP6VYynKWwxLQcNJy3Twbu82ZDlR/o=
6-
github.com/cli/go-gh v1.2.1/go.mod h1:Jxk8X+TCO4Ui/GarwY9tByWm/8zp4jJktzVZNlTW5VM=
75
github.com/cli/go-gh/v2 v2.10.0 h1:GMflBKoErBXlLvN2euxzL+p7JaM8erlSmw0cT7uZr7M=
86
github.com/cli/go-gh/v2 v2.10.0/go.mod h1:MeRoKzXff3ygHu7zP+NVTT+imcHW6p3tpuxHAzRM2xE=
97
github.com/cli/safeexec v1.0.0 h1:0VngyaIyqACHdcMNWfo6+KdUYnqEr2Sg+bSP1pdF+dI=
@@ -27,8 +25,6 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE
2725
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
2826
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
2927
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
30-
github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s=
31-
github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8=
3228
github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo=
3329
github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8=
3430
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=

main.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"net/url"
1010
"strings"
1111

12-
gh "github.com/cli/go-gh"
13-
"github.com/cli/go-gh/pkg/repository"
12+
"github.com/cli/go-gh/v2/pkg/api"
13+
"github.com/cli/go-gh/v2/pkg/repository"
1414
"github.com/spf13/pflag"
1515

1616
"github.com/advanced-security/gh-sbom/pkg/cyclonedx"
@@ -178,7 +178,7 @@ type RepoResp struct {
178178
}
179179

180180
func getRepoLicense(owner, repo string) string {
181-
client, err := gh.RESTClient(nil)
181+
client, err := api.DefaultRESTClient()
182182
if err != nil {
183183
return ""
184184
}
@@ -205,7 +205,7 @@ func main() {
205205
var err error
206206

207207
if *repoOverride == "" {
208-
repo, err = gh.CurrentRepository()
208+
repo, err = repository.Current()
209209
} else {
210210
repo, err = repository.Parse(*repoOverride)
211211
}
@@ -215,10 +215,10 @@ func main() {
215215
}
216216

217217
if *cdx {
218-
dependencies := dg.GetDependencies(repo.Owner(), repo.Name())
218+
dependencies := dg.GetDependencies(repo.Owner, repo.Name)
219219

220220
if len(dependencies) == 0 {
221-
log.Fatal("No dependencies found\n\nIf you own this repository, check if Dependency Graph is enabled:\nhttps://" + repo.Host() + "/" + repo.Owner() + "/" + repo.Name() + "/settings/security_analysis\n\n")
221+
log.Fatal("No dependencies found\n\nIf you own this repository, check if Dependency Graph is enabled:\nhttps://" + repo.Host + "/" + repo.Owner + "/" + repo.Name + "/settings/security_analysis\n\n")
222222
}
223223

224224
components := []cyclonedx.Component{}
@@ -268,12 +268,12 @@ func main() {
268268
fmt.Println(string(jsonBinary))
269269

270270
} else {
271-
client, err := gh.RESTClient(nil)
271+
client, err := api.DefaultRESTClient()
272272
if err != nil {
273273
log.Fatal(err)
274274
}
275275

276-
url := "repos/" + repo.Owner() + "/" + repo.Name() + "/dependency-graph/sbom"
276+
url := "repos/" + repo.Owner + "/" + repo.Name + "/dependency-graph/sbom"
277277
response := struct{
278278
SBOM map[string]interface{}
279279
}{}

0 commit comments

Comments
 (0)