From 1ab18bde5593e7151bd75f60356cf53a524ee757 Mon Sep 17 00:00:00 2001 From: Wil Thomason Date: Fri, 5 Aug 2022 13:21:12 -0700 Subject: [PATCH] feature: apply clang-format to PRs before merge --- .github/workflows/format.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/format.yml diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 000000000..e6ce04e5c --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,27 @@ +name: Clang Format + +on: + pull_request: + types: [ opened, synchronize ] + branches: [ master ] + +jobs: + jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: DoozyX/clang-format-lint-action@v0.14 + with: + source: '.' + exclude: './docs' + extensions: 'h,cpp,c,cc,hh,hpp' + clangFormatVersion: 14 + inplace: True + - uses: EndBug/add-and-commit@v9 + with: + author_name: clang-format bot + author_email: clangformat@kavrakilab.org # Fake email + message: 'Format with clang-format' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}