Want to learn how to build your own GitHub Actions? Click here
< Back to more bits
GitHub View Source

GitHub Actions

Markdown Meta

#pull-request
name: Markdown Meta
on: push
jobs:
markdown-meta:
name: Markdown Meta
runs-on: ubuntu-latest
steps:
- name: Markdown Meta
uses: mheap/markdown-meta-[email protected]
id: meta
with:
file: ./my-post.md
- name: Output the post title
run: echo "${{ steps.meta.output.title }}"

Context

This action allows you to read any frontmatter from a markdown file to be used in your GitHub Action workflows.

It is useful when automating additional tasks based on the contents of a file. For example, when generating an opengraph image automatically when a pull request containing a blog post is merged.

If you'd like to understand how this action works under the hood, check out the GitHub Action Spotlight covering it.