fmt/.github/workflows/lint.yml
StepSecurity Bot 4a13f79b76
[StepSecurity] ci: Harden GitHub Actions
Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
2023-12-20 00:04:27 +00:00

32 lines
597 B
YAML

name: lint
on:
pull_request:
paths:
- '**.h'
- '**.cc'
permissions:
contents: read
jobs:
format_code:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2
with:
egress-policy: audit
- uses: actions/checkout@v4
- name: Install clang-format
uses: aminya/setup-cpp@v1
with:
clangformat: 17.0.5
- name: Run clang-format
run: |
find include src -name '*.h' -o -name '*.cc' | xargs clang-format -i -style=file -fallback-style=none
git diff --exit-code