name: clang-format

on:
  push:
    branches:
      - master
    paths-ignore:
      - '*.md'
      - 'docs/**'
  pull_request:
    types: [ opened, synchronize ]
    paths-ignore:
      - '*.md'
      - 'docs/**'

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  formatting-check:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
      with:
        fetch-depth: 0

    - name: Formatting Check
      uses: jidicula/clang-format-action@4726374d1aa3c6aecf132e5197e498979588ebc8 # v4.15.0
      with:
        clang-format-version: '20'
        exclude-regex: '/bindings/'
