diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 1386b9ad..04b7a60c 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -10,6 +10,8 @@ jobs: steps: - name: Check out repo uses: actions/checkout@v2 + with: + fetch-depth: 2 - name: Install Markdownlint-cli run: | @@ -17,4 +19,4 @@ jobs: - name: Lint run: | - markdownlint -i _* --disable MD033 MD034 MD013 MD024 MD036 -- . + bash ./wiki-tools/lint.sh diff --git a/wiki-tools/lint.sh b/wiki-tools/lint.sh new file mode 100644 index 00000000..0b8e4d5d --- /dev/null +++ b/wiki-tools/lint.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +CHANGED=$(git diff --name-only HEAD HEAD~1 | grep -v '^_' | grep '.md$') +if [ "$CHANGED" == "" ]; then + exit 0 +fi +markdownlint -i '_*' --disable MD033 MD034 MD013 MD024 MD036 -- $CHANGED