Skip to content
edit

GitHub Action

Replace Value(s)

v1.1 Latest version

Replace Value(s)

edit

Replace Value(s)

GitHub Action to replace value(s) in a specific file :octocat:

Installation

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

              

- name: Replace Value(s)

uses: GuillaumeFalourd/replace-values-action@v1.1

Learn more about this action in GuillaumeFalourd/replace-values-action

Choose a version

Replace Values Action

Action test on Ubuntu Action test on MacOS Action test on Windows

โ˜ž GitHub Action to replace values in a specific file :octocat:

๐Ÿ“š Usage

Simple value

- name: Replace simple value in a specific file
  uses: GuillaumeFalourd/replace-values-action@v1.1
  with:
    file_path: ./path/to/file
    parameters: value1 >> value2

Multiline values

- name: Replace multiple values in a specific file
  uses: GuillaumeFalourd/replace-values-action@v1.1
  with:
    file_path: ./path/to/file
    parameters: |
       current_value_1 >> new_value_1
       current_value_2 >> new_value_2
       

โ–ถ๏ธ Action Inputs

Field Mandatory Observation
file_path YES Path to the file to update.
parameters YES value_to_replace >> new_value (can be an array).

๐Ÿ—‚ Changelog

@v1

This version performs a split for the :: informed in each line of the parameters input, to identify the old value to replace and the new value to set instead.

@v1.1

This version performs a split for the >> informed in each line of the parameters input, to identify the old value to replace and the new value to set instead.

๐Ÿค Contributing

โ˜ž If you're interested in contributing to this repository, please follow the guidelines

๐Ÿ… Licensed

โ˜ž This repository uses the Apache License 2.0