From a0e4df7fd1417589935d4e465c6a53ff73612eb8 Mon Sep 17 00:00:00 2001 From: Kevin Deldycke Date: Mon, 7 Dec 2020 15:02:52 +0100 Subject: [PATCH] Auto-format markdown. --- .github/workflows/autofix.yaml | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/.github/workflows/autofix.yaml b/.github/workflows/autofix.yaml index ffe7df8..2841541 100644 --- a/.github/workflows/autofix.yaml +++ b/.github/workflows/autofix.yaml @@ -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 " + 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