From e374a889e2005b7e4fff90172f5be5bed0114f3d Mon Sep 17 00:00:00 2001 From: Vadim Nifadev <36514612+nifadyev@users.noreply.github.com> Date: Fri, 28 Feb 2025 09:05:27 +0300 Subject: [PATCH] Setup markdownlint Github Action --- .github/workflows/pr.yml | 7 +++++++ .markdownlint.yaml | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 4da1774..2120da7 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -14,4 +14,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Write git diff to temp file + run: | + git fetch origin + git diff origin/${{ github.base_ref }} --unified=0 *.md translations/*/*.md \ + > ${{ runner.temp }}/diff.md - uses: DavidAnson/markdownlint-cli2-action@v17 + with: + globs: "${{ runner.temp }}/diff.md" diff --git a/.markdownlint.yaml b/.markdownlint.yaml index 7ebffd8..09e4e92 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -1,4 +1,3 @@ -# MD013/line-length MD013: line_length: 120 @@ -13,3 +12,6 @@ MD033: false # no-inline-html : Bare URL used (site should be attributed transparently, because otherwise we have to un-necesarily explain where the link directs) MD034: false + +# first-line-h1 : First line in a file should be a top-level heading (Ignore because diff file will never have valid heading) +MD041: false