Skip to content

Commit

Permalink
Remove go-gh v1.2.1 from main as well
Browse files Browse the repository at this point in the history
  • Loading branch information
steiza committed Sep 20, 2024
1 parent d8402b1 commit b86894e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ go 1.21
toolchain go1.23.1

require (
github.com/cli/go-gh v1.2.1
github.com/cli/go-gh/v2 v2.10.0
github.com/cli/shurcooL-graphql v0.0.4
github.com/spf13/pflag v1.0.5
Expand Down
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ github.com/MakeNowJust/heredoc v1.0.0 h1:cXCdzVdstXyiTqTvfqk9SDHpKNjxuom+DOlyEeQ
github.com/MakeNowJust/heredoc v1.0.0/go.mod h1:mG5amYoWBHf8vpLOuehzbGGw0EHxpZZ6lCpQ4fNJ8LE=
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
github.com/cli/go-gh v1.2.1 h1:xFrjejSsgPiwXFP6VYynKWwxLQcNJy3Twbu82ZDlR/o=
github.com/cli/go-gh v1.2.1/go.mod h1:Jxk8X+TCO4Ui/GarwY9tByWm/8zp4jJktzVZNlTW5VM=
github.com/cli/go-gh/v2 v2.10.0 h1:GMflBKoErBXlLvN2euxzL+p7JaM8erlSmw0cT7uZr7M=
github.com/cli/go-gh/v2 v2.10.0/go.mod h1:MeRoKzXff3ygHu7zP+NVTT+imcHW6p3tpuxHAzRM2xE=
github.com/cli/safeexec v1.0.0 h1:0VngyaIyqACHdcMNWfo6+KdUYnqEr2Sg+bSP1pdF+dI=
Expand All @@ -27,8 +25,6 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U=
github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w=
github.com/muesli/reflow v0.3.0 h1:IFsN6K9NfGtjeggFP+68I4chLZV2yIKsXJFNZ+eWh6s=
github.com/muesli/reflow v0.3.0/go.mod h1:pbwTDkVPibjO2kyvBQRBxTWEEGDGq0FlB1BIKtnHY/8=
github.com/muesli/termenv v0.15.2 h1:GohcuySI0QmI3wN8Ok9PtKGkgkFIk7y6Vpb5PvrY+Wo=
github.com/muesli/termenv v0.15.2/go.mod h1:Epx+iuz8sNs7mNKhxzH4fWXGNpZwUaJKRS1noLXviQ8=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down
16 changes: 8 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"net/url"
"strings"

gh "github.com/cli/go-gh"
"github.com/cli/go-gh/pkg/repository"
"github.com/cli/go-gh/v2/pkg/api"
"github.com/cli/go-gh/v2/pkg/repository"
"github.com/spf13/pflag"

"github.com/advanced-security/gh-sbom/pkg/cyclonedx"
Expand Down Expand Up @@ -178,7 +178,7 @@ type RepoResp struct {
}

func getRepoLicense(owner, repo string) string {
client, err := gh.RESTClient(nil)
client, err := api.DefaultRESTClient()
if err != nil {
return ""
}
Expand All @@ -205,7 +205,7 @@ func main() {
var err error

if *repoOverride == "" {
repo, err = gh.CurrentRepository()
repo, err = repository.Current()
} else {
repo, err = repository.Parse(*repoOverride)
}
Expand All @@ -215,10 +215,10 @@ func main() {
}

if *cdx {
dependencies := dg.GetDependencies(repo.Owner(), repo.Name())
dependencies := dg.GetDependencies(repo.Owner, repo.Name)

if len(dependencies) == 0 {
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")
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")
}

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

} else {
client, err := gh.RESTClient(nil)
client, err := api.DefaultRESTClient()
if err != nil {
log.Fatal(err)
}

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

0 comments on commit b86894e

Please sign in to comment.