diff --git a/main.go b/main.go index 7f37a43..443c0c7 100644 --- a/main.go +++ b/main.go @@ -144,6 +144,7 @@ func (w *workflow) RenderCard() string { } type repositoryData struct { + HtmlUrl string `json:"html_url"` Name string `json:"full_name"` Private bool Workflows []*workflow @@ -188,9 +189,7 @@ func noTerminalRender(repos []*repositoryData) error { } fmt.Println() fmt.Println(r.Name) - // TODO leverage go-gh to determine what host to use - // (NB: go-gh needs a PR in order to help with this) - fmt.Printf("https://github.com/%s/actions\n", r.Name) + fmt.Printf("%s/actions\n", r.HtmlUrl) fmt.Println() for _, w := range r.Workflows { @@ -233,9 +232,7 @@ func terminalRender(repos []*repositoryData) error { } fmt.Println() fmt.Print(repoNameStyle.Render(r.Name)) - // TODO leverage go-gh to determine what host to use - // (NB: go-gh needs a PR in order to help with this) - fmt.Print(repoHintStyle.Render(fmt.Sprintf(" https://github.com/%s/actions\n", r.Name))) + fmt.Print(repoHintStyle.Render(fmt.Sprintf(" %s/actions\n", r.HtmlUrl))) fmt.Println() totalRows := int(math.Ceil(float64(len(r.Workflows)) / float64(cardsPerRow))) @@ -433,7 +430,7 @@ func getWorkflows(repoData repositoryData, last time.Duration) ([]*workflow, err } } - if repoData.Private { + if repoData.Private && strings.Index(repoData.HtmlUrl, "https://github.com") == 0 { for _, r := range runs { runTimingPath := fmt.Sprintf("%s/timing", r.URL) stdout, _, err = gh.Exec("api", "--cache", defaultApiCacheTime, runTimingPath, "--jq", ".billable")