File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package view
33import (
44 "fmt"
55 "net/http"
6+ "net/url"
67 "strings"
78
89 "github.com/MakeNowJust/heredoc"
@@ -101,7 +102,7 @@ func runView(opts *ViewOptions) error {
101102 }
102103
103104 if opts .Web {
104- var url string
105+ var address string
105106 if opts .YAML {
106107 ref := opts .Ref
107108 if ref == "" {
@@ -112,14 +113,14 @@ func runView(opts *ViewOptions) error {
112113 return err
113114 }
114115 }
115- url = ghrepo .GenerateRepoURL (repo , "blob/%s/%s" , ref , workflow .Path )
116+ address = ghrepo .GenerateRepoURL (repo , "blob/%s/%s" , url . QueryEscape ( ref ), url . QueryEscape ( workflow .Path ) )
116117 } else {
117- url = ghrepo .GenerateRepoURL (repo , "actions/workflows/%s" , workflow .Base ())
118+ address = ghrepo .GenerateRepoURL (repo , "actions/workflows/%s" , url . QueryEscape ( workflow .Base () ))
118119 }
119120 if opts .IO .IsStdoutTTY () {
120- fmt .Fprintf (opts .IO .Out , "Opening %s in your browser.\n " , utils .DisplayURL (url ))
121+ fmt .Fprintf (opts .IO .Out , "Opening %s in your browser.\n " , utils .DisplayURL (address ))
121122 }
122- return opts .Browser .Browse (url )
123+ return opts .Browser .Browse (address )
123124 }
124125
125126 if opts .YAML {
You can’t perform that action at this time.
0 commit comments