mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-02-28 00:56:30 +00:00
remove port when creating default workspace path
This commit is contained in:
parent
108184daeb
commit
d01756ed80
1 changed files with 5 additions and 0 deletions
|
@ -2,6 +2,7 @@ package agent
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net"
|
||||||
"net/url"
|
"net/url"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
@ -128,6 +129,10 @@ func (a *Agent) prep(w *queue.Work) (*yaml.Config, error) {
|
||||||
|
|
||||||
src := "src"
|
src := "src"
|
||||||
if url, _ := url.Parse(w.Repo.Link); url != nil {
|
if url, _ := url.Parse(w.Repo.Link); url != nil {
|
||||||
|
host, _, err := net.SplitHostPort(url.Host)
|
||||||
|
if err == nil {
|
||||||
|
url.Host = host
|
||||||
|
}
|
||||||
src = filepath.Join(src, url.Host, url.Path)
|
src = filepath.Join(src, url.Host, url.Path)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue