File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313 steps :
1414 - name : Checkout
1515 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
16+ with :
17+ fetch-depth : 1
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+ PUSH_BEFORE_SHA : ${{ github.event.before }}
25+ GITHUB_SHA : ${{ github.sha }}
26+ run : |
27+ if [ "$EVENT_NAME" = "pull_request" ]; then
28+ git fetch --no-tags --depth=1 origin "$PR_BASE_SHA"
29+ git diff --check "$PR_BASE_SHA" HEAD
30+ elif [ "$PUSH_BEFORE_SHA" = "0000000000000000000000000000000000000000" ]; then
31+ git diff-tree --check --no-commit-id --root -r "$GITHUB_SHA"
32+ else
33+ git fetch --no-tags --depth=1 origin "$PUSH_BEFORE_SHA"
34+ git diff --check "$PUSH_BEFORE_SHA" HEAD
35+ fi
1636
1737 - name : Run markdownlint-cli2
1838 uses : DavidAnson/markdownlint-cli2-action@ded1f9488f68a970bc66ea5619e13e9b52e601cd # v23
You can’t perform that action at this time.
0 commit comments