qetza / replacetokens-task

Azure Pipelines task to replace tokens in files with variables.
MIT License
11 stars 2 forks source link

Access outputs documentation has invalid syntax #47

Closed finkinfridom closed 2 weeks ago

finkinfridom commented 1 month ago

In the readme (and also the documentation into the Visual Studio Marketplace), there is this code sample

steps:
- task: qetza.replacetokens.replacetokens-task.replacetokens@6
  name: replace-tokens
  inputs:
    sources: '**/*.json'
- script: |
    echo "defaults  : $(replace-tokens.defaults }}"
    echo "files     : $(replace-tokens.files }}"
    echo "replaced  : $(replace-tokens.replaced }}"
    echo "tokens    : $(replace-tokens.tokens }}"
    echo "transforms: $(replace-tokens.transforms }}"

unfortunately, the name propery has an invalid syntax (the - char is not allowed) and the script with the echo statements contains $( opening braces but endings with }} which is invalid.

Thanks

finkinfridom commented 1 month ago

this should be the working version

  - task: qetza.replacetokens.replacetokens-task.replacetokens@6
    displayName: replace tokens in tf and tfvars files
    name: replacetokens
    inputs:
      sources: "**/*json"

  - script: |
      echo 'defaults  : $(replacetokens.defaults)'
      echo 'files     : $(replacetokens.files)'
      echo 'replaced  : $(replacetokens.replaced)'
      echo 'tokens    : $(replacetokens.tokens)'
      echo 'transforms: $(replacetokens.transforms)'
    displayName: "DEBUG replace tokens in tf and tfvars files"
qetza commented 2 weeks ago

Hi @finkinfridom, Thanks for raising the issue, documentation is now fixed :smile: