15 runs-on: ubuntu-latest
17 - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
19 - name: Install clang-format
20 uses: aminya/setup-cpp@290824452986e378826155f3379d31bce8753d76 # v0.37.0
24 - name: Run clang-format
27 find include src -name '*.h' -o -name '*.cc' | xargs clang-format -i -style=file -fallback-style=none
28 git diff | tee fmt.patch
29 if [ -s fmt.patch ]; then
32 - uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
33 if: failure() && steps.clang_format.outcome == 'failure'
35 github-token: ${{ secrets.KEY }}
37 const fs = require('fs');
38 const patch = fs.readFileSync('fmt.patch', { encoding: 'utf8' });
39 const comment = `clang-format 17.0.5 found issues in the formatting in your code:
42 View the diff from clang-format:
51 await github.rest.issues.createComment({
52 issue_number: context.issue.number,
53 owner: context.repo.owner,
54 repo: context.repo.repo,