Skip to content

Commit

Permalink
fix: Same variable with a different scope now gets an ID (#836)
Browse files Browse the repository at this point in the history
  • Loading branch information
domenicsim1 authored Dec 4, 2024
1 parent d009e07 commit 1566f96
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 1566f96

Please sign in to comment.