Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
search

GitHub Action

Replace string

v1

Replace string

search

Replace string

Use regular expressions to manipulate strings

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Replace string

uses: frabert/replace-string-action@v1

Learn more about this action in frabert/replace-string-action

Choose a version

replace-string GitHub Action

Replaces strings with regular expressions.

Inputs

pattern

Required Regular expression to match.

string

Required Input string.

replace-with

Required String to use for replacement.

Outputs

replaced

The replaced string.

Example usage

uses: frabert/replace-string-action@v1
with:
  pattern: 'Hello, (\w+)!'
  string: 'Hello, world!'
  replace-with: 'I greet you, $1!'