auto-format.yml (1139B)
1 name: Auto-formatter 2 3 on: 4 pull_request: 5 branches: 6 - main 7 - develop 8 paths: 9 - '**.cpp' 10 - '**.h' 11 12 workflow_dispatch: 13 14 jobs: 15 build_and_test: 16 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 17 name: Apply clang-format to pull request 18 runs-on: ubuntu-latest 19 20 steps: 21 - name: Install Linux Deps 22 run: | 23 sudo apt update 24 sudo apt -y install clang-format-14 25 clang-format-14 --version 26 27 - name: Checkout code 28 uses: actions/checkout@v2 29 with: 30 persist-credentials: false 31 fetch-depth: 0 32 33 - name: Run clang-format 34 shell: bash 35 working-directory: ${{github.workspace}}/Plugin 36 run: find Source/ -iname *.h -o -iname *.cpp | xargs clang-format-14 -style=file -verbose -i 37 38 - name: Commit & Push changes 39 uses: actions-js/push@master 40 with: 41 message: "Apply clang-format" 42 branch: ${{ github.head_ref }} 43 github_token: ${{ secrets.GITHUB_TOKEN }}