Skip to content

Commit 64f2d00

Browse files
committed
ci: add diff whitespace check
1 parent 6322a4d commit 64f2d00

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/lint.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,23 @@ jobs:
1313
steps:
1414
- name: Checkout
1515
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Run git diff --check
20+
shell: bash
21+
env:
22+
EVENT_NAME: ${{ github.event_name }}
23+
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
24+
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
25+
PUSH_BEFORE_SHA: ${{ github.event.before }}
26+
GITHUB_SHA: ${{ github.sha }}
27+
run: |
28+
if [ "$EVENT_NAME" = "pull_request" ]; then
29+
git diff --check "$PR_BASE_SHA" "$PR_HEAD_SHA"
30+
else
31+
git diff --check "$PUSH_BEFORE_SHA" "$GITHUB_SHA"
32+
fi
1633
1734
- name: Run markdownlint-cli2
1835
uses: DavidAnson/markdownlint-cli2-action@ded1f9488f68a970bc66ea5619e13e9b52e601cd # v23

0 commit comments

Comments
 (0)