jonlabelle/Replace tokens action

A GitHub Action that replaces tokens in files, similar to envsubst

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Stale
License
None
namedescriptionrequireddefault
pathsFile path or paths to process. Specify multiple paths on separate lines using a multiline string `|`. Wildcards are supported. Defaults to the current directory (`.`). Example: `./path/to/my/settings.json`no.
styleToken style to replace. Accepted values are `mustache` (for example, `{{ VARIABLE }}`), `handlebars` (for example, `{{ VARIABLE }}`), `brackets` (for example, `< VARIABLE >`), `hashes` (for example, `## VARIABLE ##`), `underscores` (for example, `__ VARIABLE __`), `envsubst` (for example, `${VARIABLE}`), and `make` (for example, `$(VARIABLE)`). Defaults to `mustache`.nomustache
filterFilter applied to the resolved `paths` results. Supports only `*` and `?` wildcards. Example: `*.json`no
excludeFile or directory names and patterns to exclude from the results. Wildcards are supported. Specify multiple exclusions on separate lines using a multiline string `|`. Example: `*dev*.json`no
recurseWhether to search subdirectories recursively. Defaults to `false`.nofalse
depthMaximum recursion depth. Valid only when `recurse` is enabled. A value of `0` means no depth limit.no0
encodingFile encoding to use when reading and writing files. Defaults to `auto`, which attempts to preserve the file's existing encoding. Accepted values: `auto`, `utf8`, `utf8BOM`, `ascii`, `ansi`, `bigendianunicode`, `bigendianutf32`, `oem`, `unicode`, `utf32`noauto
no-newlineDo not append a trailing newline to the file. By default, an existing trailing newline is preserved and a newline is appended only when the file does not already end with one, using the file's detected line ending style when possible.nofalse
dry-runPreview changes without modifying files. Shows what would change. By default, files are modified.nofalse
failFail the step if no files were changed. When `dry-run` is enabled, fail if no files would change.nofalse
fail-on-skippedFail the step if one or more tokens are skipped because a matching value was missing or empty.nofalse
case-insensitiveMatch environment variable names without regard to case on all platforms. Defaults to `false`, which preserves the platform default behavior.nofalse
verboseEnable verbose output. By default, verbose output is suppressed.nofalse
namedescription
tokens-replacedTotal number of tokens replaced or that would be replaced in dry-run mode.
tokens-skippedTotal number of tokens skipped because no matching value was available.
modified-files-countNumber of files updated by the action.
would-modify-files-countNumber of files that would be updated in dry-run mode.