From d832a3bd3ac2b6e7253f718f833f0da642829bec Mon Sep 17 00:00:00 2001 From: grace-rehn Date: Fri, 18 Oct 2024 13:03:24 +1000 Subject: [PATCH] fix: only append SubstituteInFiles to EnabledFeatures if its not there (#803) --- octopusdeploy/schema_action_run_script.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/octopusdeploy/schema_action_run_script.go b/octopusdeploy/schema_action_run_script.go index 16bfdf606..63dc2a430 100644 --- a/octopusdeploy/schema_action_run_script.go +++ b/octopusdeploy/schema_action_run_script.go @@ -2,6 +2,7 @@ package octopusdeploy import ( "strconv" + "strings" "github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/core" "github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/deployments" @@ -74,7 +75,7 @@ func expandRunScriptAction(flattenedAction map[string]interface{}) *deployments. if len(action.Properties["Octopus.Action.EnabledFeatures"].Value) == 0 { action.Properties["Octopus.Action.EnabledFeatures"] = core.NewPropertyValue("Octopus.Features.SubstituteInFiles", false) - } else { + } else if !strings.Contains(action.Properties["Octopus.Action.EnabledFeatures"].Value, "Octopus.Features.SubstituteInFiles") { actionProperty := action.Properties["Octopus.Action.EnabledFeatures"].Value + ",Octopus.Features.SubstituteInFiles" action.Properties["Octopus.Action.EnabledFeatures"] = core.NewPropertyValue(actionProperty, false) }