--- # DESCRIPTION: Github actions config # SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 # name: format on: push: branches-ignore: - 'dependabot/**' # Avoid duplicates: only run the PR, not the push permissions: contents: write defaults: run: working-directory: repo jobs: format: runs-on: ubuntu-24.04 name: Ubuntu 24.04 | format steps: - name: Checkout uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 with: path: repo token: ${{ secrets.GITHUB_TOKEN }} - name: Install packages for build run: | sudo apt install clang-format-18 || \ sudo apt install clang-format-18 git config --global user.email "action@example.com" git config --global user.name "github action" - name: Configure run: | autoconf ./configure - name: Set up Python venv uses: ./repo/.github/actions/setup-venv with: save: ${{ github.ref == 'refs/heads/master' }} - name: Format code run: | source .venv/bin/activate make -j 4 format CLANGFORMAT=clang-format-18 git status - name: Push run: |- if [ -n "$(git status --porcelain)" ]; then git commit . -m "Apply 'make format' [ci skip]" && git push origin fi