diff --git a/main.go b/main.go index c8443dc..855cae8 100644 --- a/main.go +++ b/main.go @@ -23,6 +23,7 @@ type Params struct { } func main() { + workspace := drone.Workspace{} repo := drone.Repo{} build := drone.Build{} vargs := Params{} @@ -30,7 +31,7 @@ func main() { plugin.Param("repo", &repo) plugin.Param("build", &build) plugin.Param("vargs", &vargs) - + plugin.Param("workspace", &workspace) plugin.MustParse() if build.Event != "tag" { @@ -40,6 +41,10 @@ func main() { return } + if len(workspace.Path) != 0 { + os.Chdir(workspace.Path) + } + if len(vargs.BaseUrl) == 0 { vargs.BaseUrl = "https://api.github.com/" } else {