Auto-format markdown.

This commit is contained in:
Kevin Deldycke
2020-12-07 15:02:52 +01:00
parent 7a7fedbd7a
commit a0e4df7fd1

View File

@@ -36,6 +36,44 @@ jobs:
commit_message: "[lint] Update TOC."
file_pattern: readme.md
markdown:
name: Format markdown and create a PR
needs: toc
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2.3.4
- name: Install Pandoc
run: |
sudo apt install pandoc
- name: Auto-format to GitHub-Flavored Markdown
run: >
pandoc ./readme.md --from=gfm --to=gfm --output=./readme.md
--columns=79 --wrap=none --tab-stop=2
- name: Auto-fix Markdown
uses: avto-dev/markdown-lint@v1.4.0
# Non-fixable markdown issues will return non-zero error code. Allow
# that step to fail so we can proceed with creating the auto-fix PR
# below.
continue-on-error: true
with:
config: '.github/markdown-lint.yaml'
args: './**/*.md'
fix: true
- uses: peter-evans/create-pull-request@v3.5.1
with:
author: "Kevin Deldycke <kevin@deldycke.com>"
commit-message: "[autofix] Format Markdown"
title: "[autofix] Format Markdown"
body: >
[Auto-generated on run
#${{ github.run_id }}](https://github.com/${{ github.repository
}}/actions/runs/${{ github.run_id }}) as defined by [workflow
action](https://github.com/${{ github.repository
}}/blob/${{ github.base_ref }}/.github/workflows/autofix.yaml).
labels: "CI/CD"
assignees: kdeldycke
branch: format-markdown
json:
name: Format JSON files and create a PR
runs-on: ubuntu-20.04