-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de5bccd
commit 4286b90
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: clang-format | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
|
||
clang-format: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
# Give the default GITHUB_TOKEN write permission to commit and push the | ||
# added or changed files to the repository. | ||
contents: write | ||
|
||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install clang-format | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y clang-format-14 | ||
sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-14 100 | ||
clang-format --version | ||
- name: Run clang-format | ||
run: | | ||
find . -type f \( -name "*.h" -o -name "*.cpp" \) -print0 | xargs -0 clang-format -i | ||
- name: Auto Commit | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: "Apply clang-format" |