From bb0b447d12041097d166f5ce49fb632a685af654 Mon Sep 17 00:00:00 2001 From: Swissky <12152583+swisskyrepo@users.noreply.github.com> Date: Wed, 13 Nov 2024 12:24:08 +0100 Subject: [PATCH] Github Action - Markdown Linting --- .github/.markdownlint.json | 6 +++++ .github/workflows/check-markdown.yml | 23 +++++++++++++++++++ .../workflows/{ci.yml => mkdocs-build.yml} | 2 +- 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .github/.markdownlint.json create mode 100644 .github/workflows/check-markdown.yml rename .github/workflows/{ci.yml => mkdocs-build.yml} (97%) diff --git a/.github/.markdownlint.json b/.github/.markdownlint.json new file mode 100644 index 00000000..a4058c32 --- /dev/null +++ b/.github/.markdownlint.json @@ -0,0 +1,6 @@ +{ + "MD013": false, + "ul-indent": { + "indent": 4 + } +} \ No newline at end of file diff --git a/.github/workflows/check-markdown.yml b/.github/workflows/check-markdown.yml new file mode 100644 index 00000000..1b33827e --- /dev/null +++ b/.github/workflows/check-markdown.yml @@ -0,0 +1,23 @@ +name: check-markdown +on: [push, pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: tj-actions/changed-files@v45 + id: changed-files + with: + files: '**/*.md' + separator: "," + + - uses: DavidAnson/markdownlint-cli2-action@v17 + if: steps.changed-files.outputs.any_changed == 'true' + with: + globs: ${{ steps.changed-files.outputs.all_changed_files }} + separator: "," + config: ./.github/.markdownlint.json \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/mkdocs-build.yml similarity index 97% rename from .github/workflows/ci.yml rename to .github/workflows/mkdocs-build.yml index 4d4181ac..da2532a9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/mkdocs-build.yml @@ -1,4 +1,4 @@ -name: ci +name: mkdocs-build on: workflow_dispatch: push: