change pwd to project workspace
This commit is contained in:
parent
2c9e796c96
commit
7e97f3a391
7
main.go
7
main.go
@ -23,6 +23,7 @@ type Params struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
workspace := drone.Workspace{}
|
||||||
repo := drone.Repo{}
|
repo := drone.Repo{}
|
||||||
build := drone.Build{}
|
build := drone.Build{}
|
||||||
vargs := Params{}
|
vargs := Params{}
|
||||||
@ -30,7 +31,7 @@ func main() {
|
|||||||
plugin.Param("repo", &repo)
|
plugin.Param("repo", &repo)
|
||||||
plugin.Param("build", &build)
|
plugin.Param("build", &build)
|
||||||
plugin.Param("vargs", &vargs)
|
plugin.Param("vargs", &vargs)
|
||||||
|
plugin.Param("workspace", &workspace)
|
||||||
plugin.MustParse()
|
plugin.MustParse()
|
||||||
|
|
||||||
if build.Event != "tag" {
|
if build.Event != "tag" {
|
||||||
@ -40,6 +41,10 @@ func main() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(workspace.Path) != 0 {
|
||||||
|
os.Chdir(workspace.Path)
|
||||||
|
}
|
||||||
|
|
||||||
if len(vargs.BaseUrl) == 0 {
|
if len(vargs.BaseUrl) == 0 {
|
||||||
vargs.BaseUrl = "https://api.github.com/"
|
vargs.BaseUrl = "https://api.github.com/"
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user