| sources | A multiline list of files to replace tokens in. Each line supports:
- multiple globbing patterns separated by a semi-colon ';' using fast-glob syntax
(you must always use forward slash '/' as a directory separator)
- 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.
| yes | — |
| variables | A JSON serialized object containing the variables values. The object 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 and all JSON supports comments.
Example: '[${ toJSON(vars) }}, ${ toJSON(secrets) }}]' will pass all defined variables and secrets.
| yes | — |
| add-bom | Add BOM when writing files. | — | false |
| case-insensitive-paths | Enable case-insensitive file path matching in glob patterns (sources and variables). | — | false |
| chars-to-escape | The characters to escape when using 'custom' escape. | — | — |
| encoding | Encoding to read and write all files.
Accepted values:
- auto: detect encoding using js-chardet
- any value supported by iconv-lite
| — | auto |
| escape | 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
| — | auto |
| escape-char | The escape character to use when using custom escape. | — | — |
| if-no-files-found | The behavior if no files are found: ignore, warn, error. | — | ignore |
| include-dot-paths | Include directories and files starting with a dot '.' in glob matching results for sources and additionalVariables. | — | false |
| log-level | 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.
| — | info |
| missing-var-action | 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
| — | none |
| missing-var-default | Default value when variable is not found. | — | "" |
| missing-var-log | The level to log key not found messages.
Accepted values:
- off
- warn
- error
| — | warn |
| no-telemetry | Opt out of the anonymous telemetry feature. You can also set the 'REPLACETOKENS_TELEMETRY_OPTOUT' environment variable to '1' or 'true'.
| — | false |
| recursive | Enable token replacements in values recusively. | — | false |
| root | The root path to use when reading files with a relative path. | — | ${{ github.workspace }} |
| separator | The separtor to use when flattening keys in variables.
Example: '{ "key": { "array": ["a1", "a2"], "sub": "s1" } }' will be flatten as '{ "key.array.0": "a1", "key.array.1": "a2", "key.sub": "s1" }'
| — | . |
| token-pattern | The token pattern to use.
Accepted values:
- default: #{ ... }#
- azpipelines: $( ... )
- custom: token-prefix ... token-suffix
- doublebraces: {{ ... }}
- doubleunderscores: __ ... __
- githubactions: #{{ ... }}
- octopus: #{ ... }
| — | default |
| token-prefix | The token prefix when using 'custom' token pattern. | — | — |
| token-suffix | The token suffix when using 'custom' token pattern. | — | — |
| transforms | Enable transforms on values. The syntax to apply transform on a value is '#{<transform>(<name>[,<parameters>])}#'.
Supported transforms:
- base64(name): base64 encode the value
- indent(name[, size, firstline]): indent lines in the value where size is the
indent size (default is '2') and firstline specifies if the first line must be
indented also (default is 'false')
- lower(name): lowercase the value
- raw(name): raw value (disable escaping)
- upper(name): uppercase the value
Example: 'key=#{upper(KEY1)}#' with '{ "KEY1": "value1" }' will result in 'key=VALUE1'
| — | false |
| transforms-prefix | The tranforms prefix when using transforms. | — | ( |
| transforms-suffix | The tranforms suffix when using transforms. | — | ) |