Skip to content

๐Ÿ“‘ Auto find & replace string in your GitHub repository

License

Notifications You must be signed in to change notification settings

miguepintor/str-replace

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

4 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

String Replace | Find and Replace Action

GitHub Marketplace Actions Status Actions Status

This action will find and replace strings in your project files.

Usage

Example workflow

This example replaces hello with world in all of your project files.

name: My Workflow
on: [push, pull_request]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: Find and Replace
      uses: shitiomatic/str-replace@master
      with:
        find: "hello"
        replace: "world"

Inputs

Input Description
find A string to find and replace in your project files. (This can be a regular expression)
replace The string to replace it with.
include (optional) A regular expression of files to include. Defaults to .*.
exclude (optional) A regular expression of files to exclude. Defaults to .git/.

Outputs

Output Description
modifiedFiles The number of files that have been modified

Examples

Including a subdirectory

You can limit your find and replace to a directory.

name: My Workflow
on: [push, pull_request]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: Find and Replace
      uses: shitiomatic/str-replace@master
      with:
        find: "hello"
        replace: "world"
        include: "justthisdirectory/"

Filter by file name

You can limit your find and replace to just files with a specific name.

name: My Workflow
on: [push, pull_request]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: Find and Replace
      uses: shitiomatic/str-replace@master
      with:
        find: "hello"
        replace: "world"
        include: "README.md"  # Will match all README.md files in any nested directory

Exclude by file type

You can set your find and replace to ignore certain file types.

name: My Workflow
on: [push, pull_request]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: Find and Replace
      uses: shitiomatic/str-replace@master
      with:
        find: "hello"
        replace: "world"
        exclude: "*.py"  # Do not modify Python files

About

๐Ÿ“‘ Auto find & replace string in your GitHub repository

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 80.7%
  • Dockerfile 19.3%