Skip to content
activity

GitHub Action

Template Render

v0.0.1 Latest version

Template Render

activity

Template Render

Render template files in GitHub Actions

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Template Render

uses: vmactions/[email protected]

Learn more about this action in vmactions/template-render

Choose a version

This file is generated from the template .github/tpl/README.tpl.md

Don't modify this file, all the changes will be lost.

please make changes to the template file instead.

render

Render templates The latest release is: v0.0.1

Non defined variables are kept as-is: {{nodefined}}

this is a TTTEST .

OK, this IS ANOTHER

#this is code:



int main() {

 //just some code.
}



${{no}}

Test

Example usage:

name: "Update Readme"
on:
  workflow_dispatch:
  push:
    branches:
      - '*'
    paths:
      - '.github/tpl/*'
      - '.github/data/*'
      - '.github/workflows/readme.yml'

  release:
    types: [ published ]
    
    
jobs:
  readme:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2

      - name: Get latest release
        id: get-latest-release
        uses: InsonusK/[email protected]
        with:
          myToken: ${{ github.token }}
          view_top: 1

      - name: Using main branch
        run: git switch main || (git fetch --all && git checkout -b main origin/main)

      - name: Update the readme.md
        uses: vmactions/render@main
        env:
          TAG_NAME: ${{ steps.get-latest-release.outputs.tag_name }}
        with:
          datafile: .github/data/datafile.ini
          files: |
            .github/tpl/README.tpl.md : README.md

      - uses: EndBug/add-and-commit@v9
        with:
          message: "Update version to ${{ steps.get-latest-release.outputs.tag_name }}"
          pull: '--rebase --autostash '
          add: |
            README.md