File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 16
16
required : true
17
17
18
18
jobs :
19
+ lint :
20
+ runs-on : ubuntu-20.04
21
+ steps :
22
+ - uses : actions/checkout@v2
23
+ - run : sudo apt-get install clang-format
24
+ - run : ./scripts/clang-format-diff.sh
25
+
19
26
build-builder-image :
20
27
strategy :
21
28
fail-fast : false
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -eo pipefail
4
+
5
+ if [ -n " $1 " ]; then
6
+ BASE_BRANCH=" $1 "
7
+ elif [ -n " $GITHUB_EVENT_BEFORE " ] && [ " push" = " $GITHUB_EVENT_NAME " ]; then
8
+ BASE_BRANCH=" $GITHUB_EVENT_BEFORE "
9
+ elif [ -n " $GITHUB_BASE_REF " ]; then
10
+ BASE_BRANCH=" origin/$GITHUB_BASE_REF "
11
+ else
12
+ BASE_BRANCH=" @{upstream}"
13
+ fi
14
+
15
+ MERGE_BASE=$( git merge-base $BASE_BRANCH HEAD)
16
+
17
+ git diff -U0 --no-color $MERGE_BASE -- ' *.c' ' *.h' | clang-format-diff -i -p1
18
+ exit $?
You can’t perform that action at this time.
0 commit comments