### XML Input File Example Source: https://context7.com/qetza/replacetokens-task/llms.txt This is an example of an XML configuration file with tokens that will be replaced by the ReplaceTokens task. ```xml ``` -------------------------------- ### External Variables File Example (vars.json) Source: https://context7.com/qetza/replacetokens-task/llms.txt Example of a JSON file containing variables that can be loaded by the task. ```json { "database": { "server": "localhost", "port": 5432, "name": "appdb" }, "features": { "enableCache": true, "maxRetries": 3 } } ``` -------------------------------- ### External Variables File Example (vars.yml) Source: https://context7.com/qetza/replacetokens-task/llms.txt Example of a YAML file containing variables that can be loaded by the task. ```yaml api: baseUrl: https://api.example.com timeout: 30000 logging: level: info format: json ``` -------------------------------- ### Complete Pipeline Example Source: https://context7.com/qetza/replacetokens-task/llms.txt A full Azure Pipeline configuration demonstrating multi-environment deployment and advanced task settings. ```yaml # azure-pipelines.yml trigger: - main parameters: - name: environment displayName: 'Target Environment' type: string default: 'dev' values: - dev - staging - prod variables: - group: 'common-variables' - group: '${{ parameters.environment }}-variables' stages: - stage: Build jobs: - job: BuildAndConfigure pool: vmImage: 'ubuntu-latest' steps: - checkout: self - task: qetza.replacetokens.replacetokens-task.replacetokens@7 name: replaceTokens displayName: 'Replace tokens in configuration files' inputs: sources: | **/appsettings.json **/config/*.yml **/*.config;!**/*.user.config additionalVariables: | - '@config/environments/${{ parameters.environment }}.json' - environment: '${{ parameters.environment }}' buildNumber: '$(Build.BuildNumber)' commitId: '$(Build.SourceVersion)' encoding: 'utf-8' tokenPattern: 'default' escape: 'auto' transforms: true recursive: true missingVarAction: 'none' missingVarLog: 'warn' ifNoFilesFound: 'error' logLevel: 'info' telemetryOptout: true - script: | echo "Replacement Summary:" echo " Files: $(replaceTokens.files)" echo " Tokens: $(replaceTokens.tokens)" echo " Replaced: $(replaceTokens.replaced)" echo " Defaults: $(replaceTokens.defaults)" displayName: 'Show replacement statistics' - publish: $(Build.SourcesDirectory) artifact: 'configured-app' ``` ```json { "database": { "server": "prod-sql.database.windows.net", "name": "ProductionDB", "maxPoolSize": 100 }, "cache": { "enabled": true, "ttlSeconds": 3600 }, "logging": { "level": "Warning", "applicationInsightsKey": "prod-key-here" } } ``` -------------------------------- ### Input File with Transformations Source: https://context7.com/qetza/replacetokens-task/llms.txt Example of an input file demonstrating various value transformations applied to variables. ```json { "password": "#{base64(DB_PASSWORD)}#", "environment": "#{upper(ENVIRONMENT)}#", "appName": "#{lower(APP_NAME)}#", "certificate": "#{raw(CERT_CONTENT)}#", "config": #{indent(YAML_CONFIG, 4, true)}# } ``` -------------------------------- ### Transform Syntax Example Source: https://context7.com/qetza/replacetokens-task/llms.txt Illustrates the general syntax for applying transformations to variables. ```text #{([, parameters])}# ``` -------------------------------- ### Advanced Glob Pattern Examples Source: https://context7.com/qetza/replacetokens-task/llms.txt Demonstrates advanced usage of glob patterns for file selection and output redirection. Use these patterns to precisely control which files are processed and where the output is placed. ```yaml - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: sources: | # Replace in all JSON files, keep in same location **/*.json # Replace in template files, output without .template extension **/*.template.config => *.config # Process specific directories with exclusions src/**/*.ts;!src/**/*.spec.ts # Multiple patterns on single line separated by semicolon environments/prod/*.json;environments/staging/*.json ``` -------------------------------- ### Access Replace Tokens Task Outputs Source: https://github.com/qetza/replacetokens-task/blob/main/README.md This example shows how to access the outputs of the Replace Tokens task, such as the number of defaults, files processed, tokens replaced, and transforms applied. ```yaml steps: - task: qetza.replacetokens.replacetokens-task.replacetokens@7 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)" ``` -------------------------------- ### XML Output File Example Source: https://context7.com/qetza/replacetokens-task/llms.txt This XML file shows the result after the ReplaceTokens task has substituted the tokens with their corresponding variable values. ```xml ``` -------------------------------- ### XML Escaping Example Source: https://context7.com/qetza/replacetokens-task/llms.txt Illustrates how special characters are escaped for XML format. ```text Input value: Output: <tag attr="value"> ``` -------------------------------- ### JSON Escaping Example Source: https://context7.com/qetza/replacetokens-task/llms.txt Demonstrates how special characters are escaped in JSON format. ```text Input value: Hello "World" Output: Hello \"World\" ``` -------------------------------- ### Multiple Target Files with Glob Patterns Source: https://context7.com/qetza/replacetokens-task/llms.txt Configure the task to process multiple files using glob patterns, including exclusions and output redirection. This example processes JSON files, excludes specific ones, and outputs to a different directory structure. ```yaml # Process all JSON files except dev configs, output to _tmp directory - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: sources: | **/*.json;!**/*.dev.json;!**/vars.json => _tmp/*.json **/*.yml config/**/*.xml ``` -------------------------------- ### Variables for Transformations Source: https://context7.com/qetza/replacetokens-task/llms.txt Sample variables used in conjunction with the input file demonstrating transformations. ```text DB_PASSWORD = "secret123" ENVIRONMENT = "production" APP_NAME = "MyApplication" CERT_CONTENT = "-----BEGIN CERTIFICATE-----\nMIIC..." YAML_CONFIG = "key1: value1\nkey2: value2" ``` -------------------------------- ### Configure Multiple Target Files Source: https://github.com/qetza/replacetokens-task/blob/main/tasks/ReplaceTokensV7/README.md Specify multiple source files or file patterns for token replacement, including exclusions and output destinations. ```yaml - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: sources: | **/*.json;!**/*.dev.json;!**/vars.json => _tmp/*.json **/*.yml ``` -------------------------------- ### Configure Replace Tokens Task with Multiple Files and Telemetry Opt-out Source: https://github.com/qetza/replacetokens-task/blob/main/README.md Use this configuration to specify multiple source files for token replacement and to opt out of sending anonymous telemetry data. ```yaml - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: telemetryOptout: true sources: | **/*.json;!**/*.dev.json;!**/vars.json => _tmp/*.json **/*.yml ``` -------------------------------- ### Configure Replace Tokens Task with Additional Variables Source: https://github.com/qetza/replacetokens-task/blob/main/README.md This configuration demonstrates how to use additional variables from files, environment variables, and inline key/value pairs for token replacement. ```yaml - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: sources: '**/*.json' additionalVariables: | - '@**/vars.(json|yml|yaml)' # read from files - '$ENV_VARS', # read from env - var1: '${{ parameters.var1 }}' var2: '${{ parameters.var2 }}' ``` -------------------------------- ### Load Variables from Files and Environment Source: https://context7.com/qetza/replacetokens-task/llms.txt Configure the task to load variables from JSON/YAML files, environment variables, or define them inline. Multiple sources are merged into a single set. ```yaml - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: sources: '**/*.json' additionalVariables: | - '@**/vars.(json|yml|yaml)' # Load from JSON/YAML files - '@config/secrets.json' # Load from specific file - '$ENV_VARS' # Load from environment variable (JSON encoded) - var1: '${{ parameters.var1 }}' # Inline key/value pairs var2: '${{ parameters.var2 }}' connectionString: 'Server=myserver;Database=mydb' ``` -------------------------------- ### Configure Additional Variables Source: https://github.com/qetza/replacetokens-task/blob/main/tasks/ReplaceTokensV7/README.md Define additional variables for token replacement, sourced from files, environment variables, or inline key/value pairs. ```yaml - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: sources: '**/*.json' additionalVariables: | - '@**/vars.(json|yml|yaml)' # read from files - '$ENV_VARS', # read from env - var1: '${{ parameters.var1 }}' # inline key/value pairs var2: '${{ parameters.var2 }}' ``` -------------------------------- ### Enable Value Transformations Source: https://context7.com/qetza/replacetokens-task/llms.txt Configure the task to enable value transformations, such as base64 encoding, case conversion, and indentation. ```yaml - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: sources: '**/*.json' transforms: true ``` -------------------------------- ### Replace Tokens Task Configuration Source: https://github.com/qetza/replacetokens-task/blob/main/tasks/ReplaceTokensV7/README.md Configuration options for the qetza.replacetokens.replacetokens-task.replacetokens@7 task. ```APIDOC ## Replace Tokens Task API ### Description This API endpoint is used to configure and execute the Replace Tokens task, which replaces tokens within specified files. ### Method Not Applicable (This describes a task configuration, not an HTTP endpoint) ### Endpoint Not Applicable ### Parameters #### Inputs - **sources** (string) - Required - A multiline list of files to replace tokens in. Supports glob patterns and output path redirection. - **addBOM** (boolean) - Optional - Add BOM when writing files. Default: false. - **additionalVariables** (string) - Optional - A YAML formatted string containing additional variable values. Can be an object, a string starting with '@' for glob patterns, a string starting with '$' for environment variables, or an array. - **caseInsensitivePaths** (boolean) - Optional - Enable case-insensitive file path matching in glob patterns. Default: true. - **charsToEscape** (string) - Optional - The characters to escape when using 'custom' escape. - **encoding** (string) - Optional - The encoding to read and write all files. Accepted values: 'auto', or any value supported by iconv-lite. Default: auto. - **escape** (string) - Optional - The character escape type to apply on each value. Accepted values: 'auto', 'off', 'json', 'xml', 'custom'. Default: auto. - **escapeChar** (string) - Optional - The escape character to use when using 'custom' escape. - **ifNoFilesFound** (string) - Optional - The behavior if no files are found. Accepted values: 'ignore', 'warn', 'error'. Default: ignore. - **includeDotPaths** (boolean) - Optional - Include directories and files starting with a dot ('.') in glob matching results. Default: true. - **logLevel** (string) - Optional - The log level. Accepted values: 'debug', 'info', 'warn', 'error'. Default: info. - **missingVarAction** (string) - Optional - The behavior if a variable is not found. Accepted values: 'none', 'keep', 'replace'. Default: none. - **missingVarDefault** (string) - Optional - The default value to use when a key is not found. Default: empty string. - **missingVarLog** (string) - Optional - The level to log key not found messages. Accepted values: 'off', 'info', 'warn', 'error'. Default: warn. - **recursive** (boolean) - Optional - Enable token replacements in values recursively. Default: false. ### Request Example ```yaml { "sources": "**/*.json; !**/local/* => out/*.json", "addBOM": true, "additionalVariables": "@**/*.json;**/*.yml;!**/local/*\n$COMPUTER_VARS\nvar1: '${{ parameters.var1 }}'", "caseInsensitivePaths": false, "charsToEscape": "<>", "encoding": "utf-8", "escape": "custom", "escapeChar": "-", "ifNoFilesFound": "warn", "includeDotPaths": false, "logLevel": "debug", "missingVarAction": "replace", "missingVarDefault": "DEFAULT_VALUE", "missingVarLog": "info", "recursive": true } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Custom Escaping Configuration Source: https://context7.com/qetza/replacetokens-task/llms.txt Set up custom escaping by defining the escape character and the specific characters to be escaped. ```yaml # Custom escaping - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: sources: '**/*.sql' escape: 'custom' escapeChar: '\' charsToEscape: ''' ``` -------------------------------- ### Default Missing Variable Handling (None/Warn) Source: https://context7.com/qetza/replacetokens-task/llms.txt Configure the task to replace missing variables with an empty string and log a warning. ```yaml # Replace missing variables with empty string and log warning (default) - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: sources: '**/*.json' missingVarAction: 'none' missingVarLog: 'warn' ``` -------------------------------- ### Output with Transformations Applied Source: https://context7.com/qetza/replacetokens-task/llms.txt The resulting JSON output after applying the specified transformations to the input variables. ```json { "password": "c2VjcmV0MTIz", "environment": "PRODUCTION", "appName": "myapplication", "certificate": "-----BEGIN CERTIFICATE-----\nMIIC...", "config": key1: value1 key2: value2 } ``` -------------------------------- ### Flattened Variables Output Source: https://context7.com/qetza/replacetokens-task/llms.txt Demonstrates how variables from nested structures are flattened using a default separator. ```text database.server = "localhost" database.port = "5432" database.name = "appdb" features.enableCache = "true" features.maxRetries = "3" ``` -------------------------------- ### Configure Replace Tokens Task Inputs Source: https://github.com/qetza/replacetokens-task/blob/main/tasks/ReplaceTokensV7/README.md This YAML snippet shows the configuration for the replacetokens-task, including sources, addBOM, and additionalVariables. ```yaml - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: # A multiline list of files to replace tokens in. # Each line supports: # - multiple glob patterns separated by a semi-colon ';' using fast-glob syntax # (you must always use forward slash '/' as a directory separator, on win32 will # automatically replace backslash with forward slash) # - outputing the result in another file adding the output path after an arrow '=>' # (if the output path is a relative path, it will be relative to the input file) # - wildcard replacement in the output file name using an asterix '*' in the input # and output file names # # Example: '**/*.json; !**/local/* => out/*.json' will match all files ending with # '.json' in all directories and sub directories except in `local` directory and the # output will be in a sub directory `out` relative to the input file keeping the file # name. # # Required. sources: '' # Add BOM when writing files. # # Optional. Default: false addBOM: '' # A YAML formatted string containing additional variable values (keys are case-insensitive). # Value can be: # - an object: properties will be parsed as key/value pairs # - a string starting with '@': value is parsed as multiple glob patterns separated # by a semi-colon ';' using fast-glob syntax to JSON or YAML files # - a string starting with '$': value is parsed as an environment variable name # containing JSON encoded key/value pairs # - an array: each item must be an object or a string and will be parsed as # specified previously # # Multiple entries are merge into a single list of key/value pairs. # # Example: # - '@**/*.json;**/*.yml;!**/local/*' # - '$COMPUTER_VARS' # - var1: '${{ parameters.var1 }}' # # will add all variables from: # - '.json' and '.yml' files except under 'local' directory, # - the environment variable 'COMPUTER_VARS' # - the inline variable 'var1' # # Optional. additionalVariables: '' # Enable case-insensitive file path matching in glob patterns for sources and additionalVariables. # # Optional. Default: true caseInsensitivePaths: '' # The characters to escape when using 'custom' escape. # # Optional. charsToEscape: '' # The encoding to read and write all files. # # Accepted values: # - auto: detect encoding using js-chardet # - any value supported by iconv-lite # # Optional. Default: auto encoding: '' # The character escape type to apply on each value. # # Accepted values: # - auto: automatically apply JSON or XML escape based on file extension # - off: don't escape values # - json: JSON escape # - xml: XML escape # - custom: apply custom escape using escape-char and chars-to-escape # # Optional. Default: auto escape: '' # The escape character to use when using 'custom' escape. # # Optional. escapeChar: '' # The behavior if no files are found. # # Accepted values: # - ignore: do not output any message, the action do not fail # - warn: output a warning but do not fail the action # - error: fail the action with an error message # # Optional. Default: ignore ifNoFilesFound: '' # Include directories and files starting with a dot ('.') in glob matching results for sources and additionalVariables. # # Optional. Default: true includeDotPaths: '' # The log level. # # Accepted values: # - debug # - info # - warn # - error # # Debug messages will always be sent to the internal debug system. # Error messages will always fail the action. # # Optional. Default: info logLevel: '' # The behavior if variable is not found. # # Accepted values: # - none: replace the token with an empty string and log a message # - keep: leave the token and log a message # - replace: replace with the value from missing-var-default and do not # log a message # # Optional. Default: none missingVarAction: '' # The default value to use when a key is not found. # # Optional. Default: empty string missingVarDefault: '' # The level to log key not found messages. # # Accepted values: # - off # - info # - warn # - error # # Optional. Default: warn missingVarLog: '' # Enable token replacements in values recusively. # # Example: '#{message}#' with variables '{"message":"hello #{name}#!","name":"world"}' # will result in 'hello world!' # # Optional. Default: false recursive: '' # The root path to use when reading files with a relative path. # ``` -------------------------------- ### Basic Token Replacement in YAML Source: https://context7.com/qetza/replacetokens-task/llms.txt Use this snippet to replace tokens in configuration files using Azure Pipeline variables. Ensure your variables are defined and the sources pattern correctly targets your files. ```yaml variables: DatabaseServer: 'prod-db.example.com' DatabaseName: 'ProductionDB' ApiEndpoint: 'https://api.example.com' steps: - task: qetza.replacetokens.replacetokens-task.replacetokens@7 displayName: 'Replace tokens in config files' inputs: sources: '**/*.config' ``` -------------------------------- ### Octopus Token Pattern Source: https://context7.com/qetza/replacetokens-task/llms.txt Configures the task to use the Octopus Deploy token pattern, which matches variables enclosed in '#{...}'. Note the absence of the closing '#'. ```yaml # Octopus pattern: #{ ... } - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: sources: '**/*.json' tokenPattern: 'octopus' # Matches: #{variableName} ``` -------------------------------- ### Configure File Encoding Source: https://context7.com/qetza/replacetokens-task/llms.txt Sets the encoding for file processing, supporting auto-detection or specific formats like utf-8 and utf-16le. ```yaml # Auto-detect encoding (default) - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: sources: '**/*.json' encoding: 'auto' # Force specific encoding - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: sources: '**/*.json' encoding: 'utf-8' addBOM: true # Other supported encodings - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: sources: '**/*.txt' encoding: 'utf-16le' # or utf-16be, ascii, windows1252, iso88591 ``` -------------------------------- ### GitHub Actions Token Pattern Source: https://context7.com/qetza/replacetokens-task/llms.txt Configures the task to recognize GitHub Actions style tokens, enclosed in '${{...}}'. This is useful if you are migrating from or integrating with GitHub Actions workflows. ```yaml # GitHub Actions pattern: ${{ ... }} - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: sources: '**/*.json' tokenPattern: 'githubactions' # Matches: ${{ variableName }} ``` -------------------------------- ### Configure Recursive Token Replacement Source: https://context7.com/qetza/replacetokens-task/llms.txt Enables variable values to reference other variables by setting the recursive input to true. ```yaml variables: GREETING: 'Hello #{NAME}#!' NAME: 'World' FULL_MESSAGE: '#{GREETING}# Welcome to #{APP}#.' APP: 'MyApp' steps: - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: sources: '**/*.txt' recursive: true ``` -------------------------------- ### Fail Task on Missing Variable Source: https://context7.com/qetza/replacetokens-task/llms.txt Configure the task to fail immediately if any referenced variable is missing. ```yaml # Fail the task when variable is missing - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: sources: '**/*.json' missingVarAction: 'none' missingVarLog: 'error' ``` -------------------------------- ### Default Token Pattern Source: https://context7.com/qetza/replacetokens-task/llms.txt Configures the task to use the default token pattern, which matches variables enclosed in '#{...}#'. Ensure your configuration files use this pattern for replacement. ```yaml # Default pattern: #{ ... }# - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: sources: '**/*.json' tokenPattern: 'default' # Matches: #{variableName}# ``` -------------------------------- ### Custom Token Pattern Source: https://context7.com/qetza/replacetokens-task/llms.txt Define a custom token pattern by specifying unique prefix and suffix strings. This allows flexibility for non-standard token formats in your configuration files. ```yaml # Custom pattern with your own prefix/suffix - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: sources: '**/*.json' tokenPattern: 'custom' tokenPrefix: '<%=' tokenSuffix: '%>' # Matches: <%=variableName%> ``` -------------------------------- ### Replace Missing Variable with Default Source: https://context7.com/qetza/replacetokens-task/llms.txt Configure the task to replace missing variables with a specified default value. ```yaml # Replace with default value when variable is missing - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: sources: '**/*.json' missingVarAction: 'replace' missingVarDefault: 'NOT_SET' ``` -------------------------------- ### Auto-detect Escape Type Source: https://context7.com/qetza/replacetokens-task/llms.txt Configure the task to automatically detect the escape type based on the file extension. This is the default behavior. ```yaml # Auto-detect escape type based on file extension (default) - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: sources: '**/*' escape: 'auto' ``` -------------------------------- ### Azure Pipelines Token Pattern Source: https://context7.com/qetza/replacetokens-task/llms.txt Sets the token pattern to match Azure Pipelines variables, which are enclosed in '$(...)'. Use this when your tokens follow the standard Azure Pipelines variable syntax. ```yaml # Azure Pipelines pattern: $( ... ) - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: sources: '**/*.json' tokenPattern: 'azpipelines' # Matches: $(variableName) ``` -------------------------------- ### Access Task Output Variables Source: https://context7.com/qetza/replacetokens-task/llms.txt Retrieves replacement statistics and status variables for use in subsequent pipeline steps. ```yaml steps: - task: qetza.replacetokens.replacetokens-task.replacetokens@7 name: replaceTokens inputs: sources: '**/*.json' - script: | echo "Files processed : $(replaceTokens.files)" echo "Tokens found : $(replaceTokens.tokens)" echo "Tokens replaced : $(replaceTokens.replaced)" echo "Default values : $(replaceTokens.defaults)" echo "Transforms done : $(replaceTokens.transforms)" displayName: 'Display replacement statistics' - script: | if [ "$(replaceTokens.tokens)" -gt "$(replaceTokens.replaced)" ]; then echo "Warning: Not all tokens were replaced!" fi displayName: 'Check replacement completeness' ``` -------------------------------- ### Double Underscores Token Pattern Source: https://context7.com/qetza/replacetokens-task/llms.txt Sets the token pattern to match variables enclosed in '__...__'. This pattern is often used in specific frameworks or custom configurations. ```yaml # Double underscores pattern: __ ... __ - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: sources: '**/*.json' tokenPattern: 'doubleunderscores' # Matches: __variableName__ ``` -------------------------------- ### Disable Escaping Source: https://context7.com/qetza/replacetokens-task/llms.txt Configure the task to disable all character escaping for variable replacements. ```yaml # Disable escaping - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: sources: '**/*.txt' escape: 'off' ``` -------------------------------- ### Force XML Escaping Source: https://context7.com/qetza/replacetokens-task/llms.txt Explicitly set the escape type to XML for all files, regardless of their extension. ```yaml # Force XML escaping for all files - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: sources: '**/*.config' escape: 'xml' ``` -------------------------------- ### Double Braces Token Pattern Source: https://context7.com/qetza/replacetokens-task/llms.txt Uses the double braces token pattern, matching variables enclosed in '{{...}}'. This pattern is common in templating engines. ```yaml # Double braces pattern: {{ ... }} - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: sources: '**/*.json' tokenPattern: 'doublebraces' # Matches: {{ variableName }} ``` -------------------------------- ### Keep Original Token on Missing Variable Source: https://context7.com/qetza/replacetokens-task/llms.txt Set the task to retain the original token in the output if the corresponding variable is not found, logging the event. ```yaml # Keep original token when variable is missing - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: sources: '**/*.json' missingVarAction: 'keep' missingVarLog: 'info' ``` -------------------------------- ### Force JSON Escaping Source: https://context7.com/qetza/replacetokens-task/llms.txt Explicitly set the escape type to JSON for all files, regardless of their extension. ```yaml # Force JSON escaping for all files - task: qetza.replacetokens.replacetokens-task.replacetokens@7 inputs: sources: '**/*.txt' escape: 'json' ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.