Skip to content
edit

GitHub Action

String Replacer

v1.0.2 Latest version

String Replacer

edit

String Replacer

A GitHub Action for finding and replacing strings in your project files

Installation

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

              

- name: String Replacer

uses: thiagodnf/[email protected]

Learn more about this action in thiagodnf/string-replacer

Choose a version

String Replacer

A GitHub Action for finding and replacing strings in your project files

GitHub Release GitHub contributors GitHub stars MIT Licence Open Source Love

Input

find

Required The regular expression you want to be replaced

replace

Required The new string to be replaced

include

Optional A glob of files to include in our find and replace. Default is **

exclude

Optional A glob of files to exclude in our find and replace. Default is .git/**

Outputs

modifiedFiles

The number of files which have been modified

Usage

Example workflow

name: My Workflow

on: [push, pull_request]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
     
      - uses: actions/checkout@main
     
      - name: Find and Replace
        uses: thiagodnf/[email protected]
        with:
          find: "hello"
          replace: "world"
          include: |
            test/**/*.md
          exclude: |
            .git/**
            node_modules/**

Questions or Suggestions

Feel free to access the discussions tab as you need

Contribute

Contributions to this project are very welcome! We can't do this alone! Feel free to fork this project, work on it and then make a pull request.

License

Licensed under the MIT license.

Donate

I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).

However, if you get some profit from this or just want to encourage me to continue creating stuff, reach out to me if you want to do it.

Thanks!

❤️