Substitute Variables in Files in step template

I have a custom step template where I have added the feature “Substitute Variables in Files”.

The substitution is going to be optional, as not all end users of the template will want to do variable substitution.

Now when a user of the step template doesn’t want to perform variable substitution they are leaving the input value blank.

On the surface this is fine, but what i’m seeing is that when a deployment occurs there is a warning shown as follows:

This isn’t ideal, as the intended action I was hoping for that when no value is specified that the substitution wouldn’t run.

I have tested that when I specify a value of “none” that it is passing through as expected:

This is how the parameter is configured:

We are running:

image

1 Like

Hi Jon,

Thanks for getting in touch!

You can get this blank value by creating an unscoped project variable named cd.substitute.variables.files with no value. When a user doesn’t want to perform substitution and leaves this field blank, it will then write in the log [Octopus.Action.SubstituteInFiles.TargetFiles] = '' as opposed to the unevaluated variable name.

I hope this helps! Let me know how you go or if you have any further questions moving forward. :slight_smile:

Best regards,

Kenny

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.