Skip to content
filter

GitHub Action

Variables in Markdown

v1.0.0 Latest version

Variables in Markdown

filter

Variables in Markdown

Allows variable templating in Markdown

Installation

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

              

- name: Variables in Markdown

uses: bdougie/variables-in-markdown@v1.0.0

Learn more about this action in bdougie/variables-in-markdown

Choose a version

Variables in Markdown

This GitHub Action will allow you to set variables in Markdown and interpolate throughout your GitHub Issue.

Usage

This GitHub Action that replaces template in your variables

on: issues
name: Template Variables in Markdown
jobs:
  markdown:
    name: markdown-marker
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - uses: bdougie/variables-in-markdown@master
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Testing

This action is best used with issue templates. Create an example .github/ISSUE_TEMPLATE.md file. This file should have front matter to help construct the new issue:

---
title: New Issue
labels: bug, enhancement
---
<!--#
NOUN=mother
ATTRIBUTION=Mark Wahlberg
$-->

"Say hi to your {{ NOUN }} for me," {{ ATTRIBUTION }}

You'll notice that the above example has some {{ MUSTACHE }} variables. This is needed for the API to find and replace variables. This is powered by the marky_markdown ruby gem.