Open twinpiloot opened 5 months ago
Hi @twinpiloot,
Could you provide some logs as i have no issue using transforms
in the new version 6 of the task; i also kept enableTransforms
as alias in v6 to simplify upgrade.
For previous versions the input name hasn't changed.
Hi, I've attached the log. Look for "##[error]variable 'upper(Infra.Environment.ShortName)' not found". After I changed it to enabledTransforms: true, it worked again.
That's strange, could you share your the task configuration so that i can try to reproduce?
using the following pipeline
trigger: none
pool:
vmImage: ubuntu-latest
variables:
Infra.Environment.ShortName: infra_name
steps:
- task: replacetokens@6
inputs:
root: issue-25
sources: '*.txt'
logLevel: debug
missingVarLog: error
transforms: true
- pwsh: cat issue-25/config.txt
on the file
raw : "#{Infra.Environment.ShortName}#"
upper: "#{upper(Infra.Environment.ShortName)}#"
the replace and transform are done
and the output is as expected
raw : "infra_name"
upper: "INFRA_NAME"
This is what I had. Could it be that you are using version 6.0.5 and I 6.0.4?
The changes between 6.0.4 and 6.0.5 didn't change anything on inputs or transforms.
I've tested with this YAML and still it's working:
- task: replacetokens@6
inputs:
root: '$(Pipeline.Workspace)'
sources: |
**/issue-25/*.txt
encoding: 'auto'
addBOM: true
escape: 'off'
missingVarLog: error
keepToken: false
tokenPrefix: '#{'
tokenSufix: '#{'
transforms: true
logLevel: debug
I though maybe it was the agent not understanding input aliases but you are using other aliases (root, sources, addBOM...) without issues.
Could you share a redacted log with system diagnostics enabled to see what are the inputs received by the task and also the azure pipelines agent version?
Also not that you should replace keepToken: false
with missingVarAction: none
It works for me :-)
The release notes say that enableTransforms has been renamed to transforms. This does not seem to be true. transforms does not work while enableTransforms still work.