auto-clang-format.yml 834 B

1234567891011121314151617181920212223242526272829303132333435
  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. - name: Update Permissions
  23. run: sudo chown --recursive $USER .
  24. - uses: stefanzweifel/git-auto-commit-action@v4.16.0
  25. with:
  26. commit_message: CLang format changes
  27. branch: ${{ github.head_ref }}