@@ -4,71 +4,14 @@ import (
44 "bytes"
55 "fmt"
66 "io"
7- "net/http"
87 "time"
98
109 cliapi "github.com/cli/cli/v2/api"
1110 "github.com/cli/cli/v2/pkg/cmd/run/shared"
1211 "github.com/cli/cli/v2/pkg/cmdutil"
1312 "github.com/cli/cli/v2/pkg/iostreams"
14- "github.com/cli/go-gh/pkg/auth"
15- "github.com/cli/go-gh/pkg/config"
1613)
1714
18- // Conf implements the cliapi tokenGetter interface
19- type Conf struct {
20- * config.Config
21- }
22-
23- // AuthToken implements the cliapi tokenGetter interface
24- // by providing a method for retrieving the auth token.
25- func (c * Conf ) AuthToken (hostname string ) (string , string ) {
26- return auth .TokenForHost (hostname )
27- }
28-
29- type workflowRun struct {
30- ID int64 `json:"id"`
31- WorkflowID int `json:"workflow_id"`
32- Name string `json:"name"`
33- Status shared.Status `json:"status"`
34- Conclusion string `json:"conclusion"`
35- }
36-
37- type workflowRunsResponse struct {
38- WorkflowRuns []workflowRun `json:"workflow_runs"`
39- }
40-
41- type dispatchOptions struct {
42- repo * ghRepo
43- httpClient * http.Client
44- io * iostreams.IOStreams
45- }
46-
47- // ghRepo satisfies the ghrepo interface...
48- // See github.com/cli/cli/v2/internal/ghrepo.
49- type ghRepo struct {
50- Name string
51- Owner string
52- }
53-
54- func (r ghRepo ) RepoName () string {
55- return r .Name
56- }
57-
58- func (r ghRepo ) RepoOwner () string {
59- return r .Owner
60- }
61-
62- func (r ghRepo ) RepoHost () string {
63- host , _ := auth .DefaultHost ()
64-
65- return host
66- }
67-
68- func (r ghRepo ) RepoFullName () string {
69- return fmt .Sprintf ("%s/%s" , r .RepoOwner (), r .RepoName ())
70- }
71-
7215func render (ios * iostreams.IOStreams , client * cliapi.Client , repo * ghRepo , run * shared.Run ) error {
7316 cs := ios .ColorScheme ()
7417 annotationCache := map [int64 ][]shared.Annotation {}
0 commit comments