Skip to content
Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Malnati/templateer

A simple engine to render templates in GitHub Actions using environment variables.

Release License Issues


What it is

Release

Templateer is a GitHub composite action that renders template files using envsubst based on environment variables available in the GitHub Actions step/job.

  • Accepts template and result
  • Optionally prints exported variables via debug=true
  • Produces outputs: path and body

How it works

  1. Exports environment variables to $GITHUB_ENV (except those starting with GITHUB_)
  2. Runs envsubst to replace placeholders (e.g., $VAR) in the template
  3. Publishes the rendered file path and rendered content as outputs

Release

Inputs

Input Required Default Description
template Yes - Template file path
result Yes - Rendered output file path
debug No false If true, prints exported variables to logs

Outputs

Output Description
path Rendered file path
body Rendered content (multiline)

Usage example

1) Template

# .github/templates/report.md
Hello, $NAME.

File: $FILE_NAME
Repository: $GITHUB_REPOSITORY

2) Workflow

# .github/workflows/example.yml
name: templateer-example

on:
  workflow_dispatch:

jobs:
  render:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Render template
        id: tpl
        uses: Malnati/templateer@v1.0.0
        env:
          NAME: Ricardo
          FILE_NAME: .reports/20251215-0100_hardcode.json
        with:
          template: .github/templates/report.md
          result: /tmp/report.rendered.md

      - name: Print path
        shell: bash
        run: echo "${{ steps.tpl.outputs.path }}"

      - name: Print content
        shell: bash
        run: |
          echo "-----"
          echo "${{ steps.tpl.outputs.body }}"
          echo "-----"

Template rules

  • Use placeholders in the $VAR format (standard envsubst syntax).
  • Variables can come from env: at the step/job level, or from previous steps via $GITHUB_ENV.

Limitations

  • envsubst only replaces environment variables; it does not support conditional logic.
  • If a variable does not exist, the placeholder may become empty in the rendered output.

License

See LICENSE.

About

Render timeline messages, checklists, and status reports consistently across workflows.

Topics

Resources

Security policy

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors