Skip to content

Commit

Permalink
fix: only append SubstituteInFiles to EnabledFeatures if its not there
Browse files Browse the repository at this point in the history
  • Loading branch information
grace-rehn committed Oct 17, 2024
1 parent 506e584 commit 9b52e3e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion octopusdeploy/schema_action_run_script.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 9b52e3e

Please sign in to comment.