qetza / replacetokens-task

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

v6 not injecting tokens where pattern is enclosed in double quotes #23

Open rebeccajenkinsquest opened 5 months ago

rebeccajenkinsquest commented 5 months ago

Issue encountered after upgrading pipelines to use v6. Here is an example of the inputs we updated to, which were tested successfully against variables indicated simply with -- but not when surrounded by double quotes--e.g., "--VARIABLE--".

                tokenPattern: custom
                tokenPrefix: '--'
                tokenSuffix: '--'

Is this behavior unexpected, or is there a recommendation for how this can be configured differently from our side?

qetza commented 5 months ago

Hi @rebeccajenkinsquest, I've tried to reproduce your issue but didn't have any error.

My test pipeline:

trigger: none

pool:
  vmImage: ubuntu-latest

variables:
  VARIABLE: value

steps:
  - task: replacetokens@6
    inputs:
      root: 'issue-23'
      sources: '*.json'
      tokenPattern: 'custom'
      tokenPrefix: '--'
      tokenSuffix: '--'
      logLevel: 'debug'

My test file issue-23/data.json

{
  "var": "--VARIABLE--"
}

output image

Could you share with me some more details? Your redacted debug logs?