Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mathieusoysal/replace-string-in-file
Replace string in file, works with ubuntu, windows, macos
https://github.com/mathieusoysal/replace-string-in-file
github-actions macos ubuntu windows
Last synced: 4 months ago
JSON representation
Replace string in file, works with ubuntu, windows, macos
- Host: GitHub
- URL: https://github.com/mathieusoysal/replace-string-in-file
- Owner: MathieuSoysal
- License: apache-2.0
- Created: 2022-12-04T13:38:43.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-20T07:29:07.000Z (12 months ago)
- Last Synced: 2024-09-16T22:19:51.863Z (5 months ago)
- Topics: github-actions, macos, ubuntu, windows
- Homepage:
- Size: 22.5 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Replace string in file
[![Test Actions on Ubunut, Macos and Windows](https://github.com/MathieuSoysal/replace-string-in-file/actions/workflows/test-actions.yml/badge.svg)](https://github.com/MathieuSoysal/replace-string-in-file/actions/workflows/test-actions.yml)
Replace string in file, works with *Ubuntu*, *Windows*, *Macos*.
## Usage
The workflow, usually declared in `.github/workflows/replace-string-in-file.yml`, looks like:
```YAML
name: Replace string in fileon:
push:
branches:
- master
- mainjobs:
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
```YAML
name: Replace string in fileon:
push:
branches:
- master
- mainjobs:
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
- Add [Nektos/act](https://www.github.com/nektos/act) to test the workflow locally
-OR-
- Use the devcontainer inside this project with [GitHub Codespaces](https://docs.github.com/fr/codespaces/getting-started/quickstart) 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](https://github.com/MathieuSoysal/Javadoc-publisher.yml/blob/main/LICENSE).