-
Notifications
You must be signed in to change notification settings - Fork 1
35 lines (28 loc) · 995 Bytes
/
clang_format.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: clang-format
on: [push, pull_request]
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install clang
run: sudo apt install -y clang-format-13
- name: config git & temporary branch
run: |
if [ `git rev-parse --verify ci_processing 2>/dev/null` ]; then
git branch -D ci_processing
fi
git config --global user.email "cont-int@github.com"
git config --global user.name "continuous integration"
git checkout -b ci_processing
- name: apply clang format
run: find . -iname *.h -o -iname *.cpp -o -iname *.hpp | xargs clang-format-13 --style=file -i
- name: push changes if any
run: |
if git commit -a -m "[skip ci] clang format" ; then
git push origin ci_processing:${BRANCH_NAME}
else
echo "No changes, nothing to commit!"
fi