-
Notifications
You must be signed in to change notification settings - Fork 2
40 lines (34 loc) · 1.02 KB
/
Copy pathclang-format.yml
File metadata and controls
40 lines (34 loc) · 1.02 KB
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
36
37
38
39
40
name: clang-format
on:
pull_request:
paths:
- '**.cpp'
- '**.cc'
- '**.cxx'
- '**.h'
- '**.hpp'
jobs:
format:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install clang-format
run: sudo apt-get install -y clang-format-17
- name: Run clang-format
run: |
find . \( -name '*.cpp' -o -name '*.cc' -o -name '*.cxx' \
-o -name '*.h' -o -name '*.hpp' \) \
-not -path './blast/extern/*' \
-not -path './build/*' \
-print0 | xargs -0 clang-format -i --style=file
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "style: apply clang-format"
commit_user_name: "github-actions[bot]"
commit_user_email: "github-actions[bot]@users.noreply.github.com"