name: lint on: push: branches: - "**" pull_request: workflow_dispatch: jobs: prettier: runs-on: [self-hosted, linux, arch, homelab] steps: - name: Checkout repository uses: actions/checkout@v4 - name: Check formatting with Prettier shell: bash run: | mapfile -t prettier_files < <( git ls-files \ | grep -E '\.(md|json|ya?ml|html|css)$' \ | grep -Ev '^(\.docs/|\.zed/|errorpages/html/|homepages/(forust_files|xdfnx_files)/)' ) if [ "${#prettier_files[@]}" -eq 0 ]; then echo "No Prettier-managed files found." exit 0 fi docker run --rm \ -v "$PWD:/work" \ -w /work \ node:22-alpine \ sh -lc 'npx --yes prettier@3 --check --ignore-unknown "$@"' sh "${prettier_files[@]}" ruff: runs-on: [self-hosted, linux, arch, homelab] steps: - name: Checkout repository uses: actions/checkout@v4 - name: Lint Python with Ruff shell: bash run: | docker run --rm \ -v "$PWD:/work" \ -w /work \ ghcr.io/astral-sh/ruff:latest \ check . yamllint: runs-on: [self-hosted, linux, arch, homelab] steps: - name: Checkout repository uses: actions/checkout@v4 - name: Lint YAML syntax shell: bash run: | docker run --rm \ -v "$PWD:/work" \ -w /work \ cytopia/yamllint:latest \ -c .yamllint . hadolint: runs-on: [self-hosted, linux, arch, homelab] steps: - name: Checkout repository uses: actions/checkout@v4 - name: Lint Dockerfiles shell: bash run: | mapfile -t dockerfiles < <( git ls-files ':(glob)**/Dockerfile' ':(glob)**/Dockerfile.*' ) if [ "${#dockerfiles[@]}" -eq 0 ]; then echo "No Dockerfiles found." exit 0 fi docker run --rm \ -v "$PWD:/work" \ -w /work \ --entrypoint hadolint \ hadolint/hadolint:latest-debian \ -c .hadolint.yaml "${dockerfiles[@]}"