Skip to content

Commit

Permalink
fix: Same variable with a different scope now gets an ID
Browse files Browse the repository at this point in the history
  • Loading branch information
domenicsim1 committed Dec 4, 2024
1 parent d009e07 commit acf12fb
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions octopusdeploy_framework/resource_variable.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,13 +267,14 @@ func validateVariable(variableSet *variables.VariableSet, newVariable *variables
for _, v := range variableSet.Variables {
if v.Name == newVariable.Name && v.Type == newVariable.Type && (v.IsSensitive || v.Value == newVariable.Value) && v.Description == newVariable.Description && v.IsSensitive == newVariable.IsSensitive {
scopeMatches, _, err := variables.MatchesScope(v.Scope, &newVariable.Scope)
if err != nil || !scopeMatches {
if err != nil {
return err
}
if scopeMatches {
newVariable.ID = v.GetID()
return nil
if !scopeMatches {
continue
}
newVariable.ID = v.GetID()
return nil
}
}

Expand Down

0 comments on commit acf12fb

Please sign in to comment.