-
-
Notifications
You must be signed in to change notification settings - Fork 24
42 lines (35 loc) · 1.06 KB
/
auto-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
36
37
38
39
40
41
42
name: Auto-formatter
on:
pull_request:
branches:
- main
- develop
paths:
- '**.cpp'
- '**.h'
workflow_dispatch:
jobs:
build_and_test:
if: contains(toJson(github.event.commits), '***NO_CI***') == false && contains(toJson(github.event.commits), '[ci skip]') == false && contains(toJson(github.event.commits), '[skip ci]') == false
name: Apply clang-format to pull request
runs-on: ubuntu-latest
steps:
- name: Install Linux Deps
run: |
sudo apt update
sudo apt -y install clang-format-14
clang-format-14 --version
- name: Checkout code
uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
- name: Run clang-format
shell: bash
run: find src/ -iname *.h -o -iname *.cpp | xargs clang-format-14 -style=file -verbose -i
- name: Commit & Push changes
uses: actions-js/push@master
with:
message: "Apply clang-format"
branch: ${{ github.head_ref }}
github_token: ${{ secrets.GITHUB_TOKEN }}