Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/markpatterson27/markdown-to-output
GitHub Action that parses a markdown file to action output. Supports frontmatter and templating.
https://github.com/markpatterson27/markdown-to-output
actions markdown
Last synced: about 2 months ago
JSON representation
GitHub Action that parses a markdown file to action output. Supports frontmatter and templating.
- Host: GitHub
- URL: https://github.com/markpatterson27/markdown-to-output
- Owner: markpatterson27
- License: mit
- Created: 2021-07-15T05:42:05.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-01T21:40:48.000Z (11 months ago)
- Last Synced: 2024-03-14T21:42:16.053Z (10 months ago)
- Topics: actions, markdown
- Language: JavaScript
- Homepage:
- Size: 2.02 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Markdown to Output Action
[![units-test](https://github.com/markpatterson27/markdown-to-output/actions/workflows/test.yml/badge.svg)](https://github.com/markpatterson27/markdown-to-output/actions/workflows/test.yml)
GitHub Action that parses a markdown file to action output. Supports frontmatter and templating.
## Usage
```yaml
name: Markdown to Output
on: push
jobs:
markdown-output:
name: Markdown to Output
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: markpatterson27/markdown-to-output@v1
id: mto
with:
filepath: examples/project.md
- run: |
echo ${{ steps.mto.outputs.attributes }}
echo ${{ steps.mto.outputs.body }}
```## Inputs
| Input Name | Required | Default | Description |
|---|---|---|---|
| `filepath` | yes | none | Path to markdown file. |## Outputs
| Output Name | Description |
|---|---|
| `attributes` | Array of parsed front matter attributes. Attribute names are converted to lowercase kebab-case with special characters removed. |
| `body` | Main body content of file. |Additionally, each attribute name will have it's own output.
## Similar projects / Inspiration
- [Markdown Meta](https://github.com/mheap/markdown-meta-action) - doesn't output body of file, just front matter attributes
- [Create an Issue Action](https://github.com/JasonEtco/create-an-issue) - file processed to creating issues. no output of file data. goal to do something similar, but want to decouple the processif just looking to read file contents to step output
```yaml
- id: read-file
run: echo "::set-output name=contents::$(cat filename.txt)" # doesn't remove CR. does remove LF :(
```