Skip to content

Bump step-security/harden-runner from 2.19.0 to 2.19.1 #273

Bump step-security/harden-runner from 2.19.0 to 2.19.1

Bump step-security/harden-runner from 2.19.0 to 2.19.1 #273

Workflow file for this run

name: Clang-format
on:
pull_request:
branches: [ "main" ]
workflow_dispatch:
permissions:
contents: read
jobs:
check-formatting:
name: Formatting Check
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@a5ad31d6a139d249332a2605b85202e8c0b78450 # v2.19.1
with:
egress-policy: audit
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install clang-format
run: |
sudo apt-get update
sudo apt-get install -y clang-format-17
- name: Run clang-format style check
run: |
# Find all C/C++ files, excluding include directory
files=$(find . -type f \( -name "*.cpp" -o -name "*.h" -o -name "*.c" \) \
! -path "./include/*" ! -path "./.git/*" | sort)
if [ -z "$files" ]; then
echo "No C/C++ files found"
exit 0
fi
# Check formatting (--dry-run -Werror exits non-zero if changes needed)
echo "$files" | xargs clang-format-17 --verbose --dry-run -Werror --style=file --fallback-style=Microsoft