Skip to content
Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Replace string in file

Test Actions on Ubunut, Macos and Windows

Replace string in file, works with Ubuntu, Windows, Macos.

Usage

The workflow, usually declared in .github/workflows/replace-string-in-file.yml, looks like:

name: Replace string in file

on:
  push:
    branches:
      - master
      - main

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - name: Replace string in file
        uses: MathieuSoysal/replace-string-in-file@v1.0.0
        with:
          file: tests/test-file.txt
          old-string: WHAT
          new-string: World

With regex

name: Replace string in file

on:
  push:
    branches:
      - master
      - main

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - name: Replace string in file
        uses: MathieuSoysal/replace-string-in-file@v1.0.0
        with:
          file: tests/test-file.txt
          old-string: 'W.*T$'
          new-string: World

Contribute

Setup development environment

-OR-

  • Use the devcontainer inside this project with GitHub Codespaces or any other IDE that supports devcontainers.

Test

  • Run act command to test the workflow locally

License

The Dockerfile and associated scripts and documentation in this project are released under the Apache 2.0 License.

About

No description, website, or topics provided.

Resources

Code of conduct

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors