mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
Add formatting check workflow for PRs
This commit is contained in:
parent
dee559bd16
commit
acbffc59f0
30
.github/workflows/clang-format
vendored
Normal file
30
.github/workflows/clang-format
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
name: Check formatting
|
||||||
|
|
||||||
|
on: pull_request
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
format-check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- uses: reviewdog/action-setup@v1
|
||||||
|
|
||||||
|
- name: Check formatting on changed lines
|
||||||
|
env:
|
||||||
|
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
git clang-format --diff origin/${{ github.base_ref }}...HEAD -- \
|
||||||
|
'*.c' '*.cpp' '*.cc' '*.h' '*.hpp' \
|
||||||
|
| reviewdog \
|
||||||
|
-name="clang-format" \
|
||||||
|
-f=diff \
|
||||||
|
-reporter=github-pr-review \
|
||||||
|
-fail-level=error \
|
||||||
|
-filter-mode=added
|
||||||
Loading…
Reference in a new issue