auto-clang-format.yml 755 B

1234567891011121314151617181920212223242526272829303132
  1. name: Auto CLang format
  2. on:
  3. pull_request:
  4. types: [opened, synchronize, reopened]
  5. branches: ['master']
  6. jobs:
  7. clang-format:
  8. runs-on: ubuntu-latest
  9. permissions:
  10. contents: write
  11. steps:
  12. - uses: actions/checkout@v3
  13. with:
  14. fetch-depth: 0
  15. ref: ${{ github.head_ref }}
  16. - name: Get last commit on ${{ github.base_ref }} branch
  17. run: echo "BASE_HEAD_REF=$(git rev-parse origin/${{ github.base_ref }})" >> $GITHUB_ENV
  18. - uses: akopachov/git-clang-format-diff-action@v1.0.0
  19. with:
  20. style: file
  21. commit: ${{ env.BASE_HEAD_REF }}
  22. - uses: stefanzweifel/git-auto-commit-action@v4
  23. with:
  24. commit_message: CLang format changes
  25. branch: ${{ github.head_ref }}