Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/badsyntax/github-action-render-template
A GitHub Action to render a Handlebars template
https://github.com/badsyntax/github-action-render-template
github-action github-actions handlebars template
Last synced: 3 months ago
JSON representation
A GitHub Action to render a Handlebars template
- Host: GitHub
- URL: https://github.com/badsyntax/github-action-render-template
- Owner: badsyntax
- License: mit
- Created: 2021-12-14T17:23:52.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-04-13T16:01:00.000Z (almost 2 years ago)
- Last Synced: 2024-10-11T20:11:41.566Z (3 months ago)
- Topics: github-action, github-actions, handlebars, template
- Language: TypeScript
- Homepage: https://github.com/marketplace/actions/render-template-handlebars
- Size: 869 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# Render Template GitHub Action
[![Build & Test](https://github.com/badsyntax/github-action-render-template/actions/workflows/test.yml/badge.svg)](https://github.com/badsyntax/github-action-render-template/actions/workflows/test.yml)
[![Render Template](https://github.com/badsyntax/github-action-render-template/actions/workflows/render-template.yml/badge.svg)](https://github.com/badsyntax/github-action-render-template/actions/workflows/render-template.yml)
[![CodeQL](https://github.com/badsyntax/github-action-render-template/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/badsyntax/github-action-render-template/actions/workflows/codeql-analysis.yml)A super simple GitHub Action to render a handlebars template.
Features
- Renders any handlebars template
- Accepts any inputs via JSON string
- Outputs an escaped string that can be used as an input to a different Action## Getting Started
```yml
name: 'Render Template'on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- masterjobs:
deploy:
name: 'Render'
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2- uses: badsyntax/[email protected]
name: Render Template
id: render-template
with:
template: '.github/pr-comment-template.hbs'
inputs: |
{
"firstName":"Bob",
"lastName":"Marley"
}- name: Output Rendered Template
run: |
echo "Rendered Template: $OUTPUT"
env:
OUTPUT: ${{ steps.render-template.outputs.result }}
```## Action Inputs
| Name | Description | Example |
| ---------- | -------------------------------------------------------------- | ----------------------------------- |
| `template` | The path to the handlebars template file | `./.github/pr-comment-template.hbs` |
| `inputs` | A JSON string object of key value pairs (can include newlines) | `{"key":"value"}` |## Action Outputs
| Name | Description | Example |
| -------- | -------------------------------------------------------------------------- | -------------------------- |
| `result` | Escaped rendered template which can be used an input to a different Action | `(your rendered template)` |## Related Projects
- [badsyntax/github-action-issue-comment](https://github.com/badsyntax/github-action-issue-comment)
## Support
- 👉 [Submit a bug report](https://github.com/badsyntax/github-action-render-template/issues/new?assignees=badsyntax&labels=bug&template=bug_report.md&title=)
- 👉 [Submit a feature request](https://github.com/badsyntax/github-action-render-template/issues/new?assignees=badsyntax&labels=enhancement&template=feature_request.md&title=)## License
See [LICENSE.md](./LICENSE.md).