diff --git a/.github/workflows/matrix.yml b/.github/workflows/matrix.yml index 11791a3a1..1101d739c 100644 --- a/.github/workflows/matrix.yml +++ b/.github/workflows/matrix.yml @@ -9,34 +9,31 @@ name: Matrix CI on: [push, pull_request] # yamllint disable-line rule:truthy +permissions: + contents: read + jobs: - yamllint: - name: yamllint - runs-on: ubuntu-latest - steps: - - name: Check out - uses: actions/checkout@v6 - - name: Run yamllint - uses: frenck/action-yamllint@v1.5.0 - ansible-lint: - name: ansible-lint + prek: + name: Run prek hooks runs-on: ubuntu-latest + container: + image: docker.io/archlinux:base-devel + steps: + # git must be installed before checkout so it does a proper clone + # (with .git directory) instead of a tarball download. + - name: Install git + run: pacman -Sy --noconfirm git + - name: Check out uses: actions/checkout@v6 - - name: Run ansible-lint - uses: ansible/ansible-lint@v26.3.0 - with: - args: "roles/custom" - setup_python: "true" - working_directory: "" - requirements_file: requirements.yml - precommit: - name: Run pre-commit - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v6 - - name: Run pre-commit - uses: pre-commit/action@v3.0.1 + - name: Install dependencies + run: pacman -S --noconfirm --needed just mise python + + - name: Run prek hooks + run: | + # The checkout action sets safe.directory using its own bundled + # git, which is separate from the pacman-installed git that prek uses. + git config --global --add safe.directory "$GITHUB_WORKSPACE" + just prek-run-on-all