Skip to content
This repository was archived by the owner on Jul 29, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion action-plugins/terraform/.version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.0-beta.4
1.1.0-beta.5
17 changes: 13 additions & 4 deletions action-plugins/terraform/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"errors"
"net/rpc"
"os"
"strconv"
"strings"
"sync"
Expand Down Expand Up @@ -57,7 +58,7 @@ func (p *Plugin) ExecuteTask(request plugins.ExecuteTaskRequest) (plugins.Respon
tf_version = param.Value
}
if param.Key == "workdir" {
workdir = param.Value
workdir = request.Workspace + "/" + param.Value
}
if param.Key == "init" {
init, _ = strconv.ParseBool(param.Value)
Expand Down Expand Up @@ -153,6 +154,14 @@ func (p *Plugin) ExecuteTask(request plugins.ExecuteTaskRequest) (plugins.Respon
}, err
}

// switch to workdir
err = os.Chdir(workdir)
if err != nil {
return plugins.Response{
Success: false,
}, err
}

installer := &releases.ExactVersion{
Product: product.Terraform,
Version: version.Must(version.NewVersion(tf_version)),
Expand Down Expand Up @@ -696,7 +705,7 @@ func (p *Plugin) Info(request plugins.InfoRequest) (models.Plugin, error) {
var plugin = models.Plugin{
Name: "Terraform",
Type: "action",
Version: "1.1.0-beta.4",
Version: "1.1.0-beta.5",
Author: "JustNZ",
Action: models.Action{
Name: "Terraform",
Expand All @@ -719,7 +728,7 @@ func (p *Plugin) Info(request plugins.InfoRequest) (models.Plugin, error) {
Title: "Working Directory",
Type: "text",
Category: "General",
Default: request.Workspace + "/",
Default: ".",
Required: true,
Description: "Working directory where terraform files are located",
},
Expand All @@ -746,7 +755,7 @@ func (p *Plugin) Info(request plugins.InfoRequest) (models.Plugin, error) {
Title: "Plan Output",
Type: "text",
Category: "Plan",
Default: request.Workspace + "/plan.tfplan",
Default: "./plan.tfplan",
Required: false,
Description: "Output the terraform plan to a file",
DependsOn: models.DependsOn{
Expand Down
Loading