Lint only changed files (#375)

* only lint changed files

* deeper

* filter for md

* de-overengineer
This commit is contained in:
David Holdeman 2023-01-12 15:56:47 -06:00 committed by GitHub
parent c3eabc33dc
commit 6d7ce283dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -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

6
wiki-tools/lint.sh Normal file
View File

@ -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