https://github.com/ntsd/liquidjs-action
Github Action to render LiquidJS
https://github.com/ntsd/liquidjs-action
github-action liquidjs
Last synced: 3 months ago
JSON representation
Github Action to render LiquidJS
- Host: GitHub
- URL: https://github.com/ntsd/liquidjs-action
- Owner: ntsd
- License: mit
- Created: 2022-11-03T17:21:19.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-11-04T17:35:57.000Z (over 3 years ago)
- Last Synced: 2024-05-02T05:51:26.690Z (about 2 years ago)
- Topics: github-action, liquidjs
- Language: TypeScript
- Homepage: https://github.com/marketplace/actions/liquidjs-render
- Size: 239 KB
- Stars: 2
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LiquidJS Github Action
Name: `ntsd/liquidjs-action@main`
Github Action to render LiquidJS.
## Inputs
`variables` - The JSON variables to render. `required`.
`template-string` - The template string to render. `optional`.
`template-file` - The file template to render. `optional`.
`output-file` - The rendered out put file. `optional`.
`output-name` - The output state name for the result. default `result`.
## Template
This action required template file or template string from input `template-file` or `template-string`. The template will render by [LiquidJS](https://liquidjs.com/).
You can find the example template file [here](https://github.com/ntsd/liquidjs-action/blob/master/example/TEMPLATE.md).
The template file will render to file input `output-file` or [Github Action Output](https://docs.github.com/en/github-ae@latest/actions/using-workflows/workflow-commands-for-github-actions#using-workflow-commands-to-access-toolkit-functions) name from input `output-name`.
## Examples
### Github Action Output render
```yml
name: Render LiquidJS
on: push
jobs:
liquidjs-job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: LiquidJS Action
id: run-liquidjs
uses: ntsd/liquidjs-action@main
with:
variables: `{"hello": "Hello LiquidJS"}`
template-string: "{{ hello }}"
- name: Echo output
run: echo "The rendered result is '${{ steps.run-liquidjs.outputs.result }}'"
```
### File render
```yml
name: Render LiquidJS
on: push
jobs:
liquidjs-job:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: LiquidJS Action
uses: ntsd/liquidjs-action@main
with:
variables: `{"hello": "Hello LiquidJS"}`
template-string: "{{ hello }}"
output-file: "./RENDER.md"
- name: Commit files
run: |
git config --local user.email "ntsd@users.noreply.github.com"
git config --local user.name "ntsd"
git commit -am "docs: auto update RENDER.md"
git push
```