replace-string-in-file

Replace string in file, works with ubuntu, windows, macos

APACHE-2.0 License

Stars
5
Committers
1

Replace string in file

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/[email protected]
        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/[email protected]
        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.

Package Rankings
Top 21.95% on Github actions
Badges
Extracted from project README
Test Actions on Ubunut, Macos and Windows