@@ -784,12 +784,15 @@ func ParseConfiguration(ctx context.Context, configurationFilePath string, opts
784784 }
785785 sort .Strings (keys )
786786
787+ configMap := buildConfigMap (& cfg )
788+ if err := cfg .PerformVarSubstitutions (configMap ); err != nil {
789+ return nil , fmt .Errorf ("applying variable substitutions: %w" , err )
790+ }
787791 for _ , k := range keys {
788792 v := items [k ]
789- replacer := replacerFromMap (map [string ]string {
790- "${{range.key}}" : k ,
791- "${{range.value}}" : v ,
792- })
793+ configMap ["${{range.key}}" ] = k
794+ configMap ["${{range.value}}" ] = v
795+ replacer := replacerFromMap (configMap )
793796
794797 thingToAdd := Subpackage {
795798 Name : replacer .Replace (sp .Name ),
@@ -835,13 +838,14 @@ func ParseConfiguration(ctx context.Context, configurationFilePath string, opts
835838 }
836839
837840 thingToAdd .Pipeline = append (thingToAdd .Pipeline , Pipeline {
838- Name : p .Name ,
839- Uses : p .Uses ,
840- With : replacedWith ,
841- Inputs : p .Inputs ,
842- Needs : p .Needs ,
843- Label : p .Label ,
844- Runs : replacer .Replace (p .Runs ),
841+ Name : p .Name ,
842+ Uses : p .Uses ,
843+ With : replacedWith ,
844+ Inputs : p .Inputs ,
845+ Needs : p .Needs ,
846+ Label : p .Label ,
847+ Runs : replacer .Replace (p .Runs ),
848+ WorkDir : replacer .Replace (p .WorkDir ),
845849 // TODO: p.Pipeline?
846850 })
847851 }
@@ -860,13 +864,14 @@ func ParseConfiguration(ctx context.Context, configurationFilePath string, opts
860864 }
861865
862866 thingToAdd .Test .Pipeline = append (thingToAdd .Test .Pipeline , Pipeline {
863- Name : p .Name ,
864- Uses : p .Uses ,
865- With : replacedWith ,
866- Inputs : p .Inputs ,
867- Needs : p .Needs ,
868- Label : p .Label ,
869- Runs : replacer .Replace (p .Runs ),
867+ Name : p .Name ,
868+ Uses : p .Uses ,
869+ With : replacedWith ,
870+ Inputs : p .Inputs ,
871+ Needs : p .Needs ,
872+ Label : p .Label ,
873+ Runs : replacer .Replace (p .Runs ),
874+ WorkDir : replacer .Replace (p .WorkDir ),
870875 // TODO: p.Pipeline?
871876 })
872877 }
0 commit comments