File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -38,11 +38,13 @@ jobs:
38
38
chmod +x git-clang-format
39
39
- name : Run git-clang-format
40
40
run : |
41
+ PR_BASE=$(git rev-list ${{ github.event.pull_request.head.sha }} ^${{ github.event.pull_request.base.sha }} | tail --lines 1 | xargs -I {} git rev-parse {}~1)
42
+ echo "running git clang-format against $PR_BASE commit"
41
43
git \
42
44
-c color.ui=always \
43
45
-c diff.wsErrorHighlight=all \
44
46
-c color.diff.whitespace='red reverse' \
45
- clang-format-15 --diff --binary clang-format-15 origin/main -- include/ lib/ || \
47
+ clang-format-15 --diff --binary clang-format-15 --commit $PR_BASE -- include/ lib/ || \
46
48
(echo "Please run the following git-clang-format locally to fix the formatting: \n
47
49
git clang-format origin/main -- include/ lib/" && exit 1)
48
50
build :
@@ -381,4 +383,4 @@ jobs:
381
383
if : ${{ success() && (matrix.coverage == true) }}
382
384
uses : codecov/codecov-action@v3
383
385
with :
384
- file : ./coverage.info
386
+ file : ./coverage.info
You can’t perform that action at this time.
0 commit comments