From 8d221a084393f340159afe64362caa5b7f9f1350 Mon Sep 17 00:00:00 2001 From: ChenYing Kuo Date: Tue, 17 Dec 2024 18:28:45 +0800 Subject: [PATCH] Add CI for checking markdown format. Signed-off-by: ChenYing Kuo --- .github/workflows/ci.yml | 11 ++++++++++- .markdownlint.yaml | 6 ++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 .markdownlint.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a7b1ef..7543585 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,6 +79,15 @@ jobs: - name: Run pytest run: pytest -n auto --import-mode=append + markdown_lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: DavidAnson/markdownlint-cli2-action@v18 + with: + config: '.markdownlint.yaml' + globs: '**/README.md' + # NOTE: In GitHub repository settings, the "Require status checks to pass # before merging" branch protection rule ensures that commits are only merged # from branches where specific status checks have passed. These checks are @@ -87,7 +96,7 @@ jobs: ci: name: CI status checks runs-on: ubuntu-latest - needs: build + needs: [build, markdown_lint] if: always() steps: - name: Check whether all jobs pass diff --git a/.markdownlint.yaml b/.markdownlint.yaml new file mode 100644 index 0000000..12f7379 --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,6 @@ +{ + "MD013": false, # Line length limitation + "MD033": false, # Enable Inline HTML + "MD041": false, # Allow first line heading + "MD045": false, # Allow Images have no alternate text +} \ No newline at end of file