A versatile GitHub Action that enables variable replacement in files using a simple {_ variable _}
syntax.
Are you tired of updating things like README version references, documentation, configuration files, and more on every release?
PRP automates this for you! With PRP, you can focus on your code while it takes care of the tedious updates.
Tip
Reference: How to Use
To install the PRP Preprocessor, you can add it as a step in your GitHub Actions workflow. Here's an example of how to use it:
steps:
- name: Checkout # Checkout the repository
uses: actions/checkout@v4
# with:
# ref: "main" # uncomment this line to check out a specific branch
- name: PRP Preprocessor
uses: CIFriends/prp-preprocessor@v1
env:
exampleVar: "Hello, World! This is an example variable."
Workflow Diagram
graph LR
A[GitHub Workflow] --> B[Checkout Action]
B --> C[PRP Preprocessor Action]
C --> D{Files with .prp extension?}
D -->|Yes| E[Process Files]
E --> F[Replace Variables]
F --> G[Commit Changes]
D -->|No| H[End Workflow]
G --> I[Push Changes]
I --> J[End Workflow]
After installing the PRP Preprocessor, you can use it to replace variables in your .prp.<any>
files.
Here's an example of how to
use it:
Using a variable in a file
example.prp.json
{
"name": "{_ exampleVar _}"
}
Output:
example.json
{
"name": "Hello, World! This is an example variable."
}
You can find the list of inputs and their descriptions in the action.yml file, or you can read the docs.
We welcome contributions to this project! Please read our Contributing Guide for more information on how to contribute.
If you've found this project useful, please consider giving it a ⭐ on GitHub. This helps to spread the awareness of the project and is a great way to show your support!
This project is licensed under the Apache-2.0 License.