Skip to content
type

GitHub Action

Regex Replace

v1.4 Latest version

Regex Replace

type

Regex Replace

Allows you to perform a regex replace within the action script

Installation

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

              

- name: Regex Replace

uses: ashley-taylor/[email protected]

Learn more about this action in ashley-taylor/regex-property-action

Choose a version

Regex Replace

Implements JavaScript replace() method.

Example

- name: Find & Replace
  id: hello
  uses: ashley-taylor/[email protected]
  with:
    value: "Hello, world!"
    regex: "world"
    flags: "" # Optional, defaults to "g"
    replacement: "universe"
- name: Print Result
  run: echo "${{ steps.hello.outputs.value }}"