testt #4
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
name: Format C++ files | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
format: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Clang | |
uses: egor-tensin/setup-clang@v1 | |
- name: Format | |
run: | | |
find . -name '*.cpp' -o -name '*.h' | xargs clang-format -i | |
- name: Commit formatted code (if any) | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git diff --exit-code || (git add . && git commit -m "Format C++ code" && git push origin test) |