GitHub Action to replace tags in files
- Description
- Inputs
- Outputs
- Examples
- Visitor stats
- Licensing
- Authors
- Versioning
- Contribution
- Acknowledgement
- Forks
- Development Support
Processes input file by replacing tags with provided input parameters.
Optional JSON data source file with action parameters:
[
{
"prefix": "<!--views:info:marker:start-->\n",
"suffix": "\n<!--views:info:marker:end-->",
"sourceFile": "./data/info.md",
"placeholder": "<!--views:info:marker:start-->[\\s\\S]*?<!--views:info:marker:end-->",
"replacement": "<p align=\"center\" style=\"text-align:center;\">Info data block</p>"
},
{
"prefix": "<!--views:readme:marker:start-->\n",
"suffix": "\n<!--views:readme:marker:end-->",
"sourceFile": "./data/readme.md",
"placeholder": "<!--views:readme:marker:start-->[\\s\\S]*?<!--views:readme:marker:end-->",
"replacement": "<p align=\"center\" style=\"text-align:center;\">Readme data block</p>"
},
{
"prefix": "test data\n",
"suffix": "",
"sourceFile": "./data/test.md",
"placeholder": "test data",
"replacement": "<p align=\"center\" style=\"text-align:center;\">Test data block</p>"
}
]
[
{
"sourceFile": "./data/info.md",
"placeholder": "<!--views:info:marker:start-->[\\s\\S]*?<!--views:info:marker:end-->",
"replacement": "<p align=\"center\" style=\"text-align:center;\">Info data block</p>"
},
{
"sourceFile": "./data/readme.md",
"placeholder": "<!--views:readme:marker:start-->[\\s\\S]*?<!--views:readme:marker:end-->",
"replacement": "<p align=\"center\" style=\"text-align:center;\">Readme data block</p>"
},
{
"sourceFile": "./data/test.md",
"placeholder": "test data",
"replacement": "<p align=\"center\" style=\"text-align:center;\">Test data block</p>"
}
]
Optional String data to prepend before replacement
Optional String data to append after replacement
Required Input source file to replace in
Required String placeholder or regex to replace by
Required String data to replace with
File processing operation status
When input source file successfully processed
When error occurred while processing input source file
- name: Replace file placeholders
uses: alexrogalskiy/github-action-tag-replacer@master
with:
prefix: '<!--views:marker:start-->\n'
suffix: '\n<!--views:marker:end-->'
sourceFile: './data/info.md'
placeholder: '<!--views:marker:start-->[\s\S]*?<!--views:marker:end-->'
replacement: '<p align="center" style="text-align:center;">Data Block</p>'
Running locally:
npm run start:action --action github-action-tag-replacer --prefix '<!--views:marker:start-->\n' --suffix '\n<!--views:marker:end-->' --sourceFile './data/info.md' --placeHolder '<!--views:marker:start-->[\s\S]*?<!--views:marker:end-->' --replacement '<p align="center" style="text-align:center;">Data Block</p>'
Tag Replacer is distributed under LGPL version 3 or later, [License]. LGPLv3 is additional permissions on top of GPLv3.
Tag Replacer is maintained by the following GitHub team-members:
with community support please contact with us if you have some question or proposition.
The project uses SemVer for versioning. For the versions available, see the tags on this repository.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us (emoji key).
This project follows the all-contributors specification. Contributions of any kind are welcome!
See also the list of contributors who participated in this project.
Like Tag Replacer ? Consider buying me a coffee :)