From f424d9140598cf2024090e5239f67e3f48cdbada Mon Sep 17 00:00:00 2001 From: mr-forust Date: Sun, 21 Jun 2026 21:51:20 +0200 Subject: [PATCH] Tighten lint workflow scope --- .gitea/workflows/lint.yaml | 16 ++++++++-- .github/workflows/lint.yaml | 16 ++++++++-- cfddns/config.json.example | 2 +- headscale/config/policy.json.example | 46 ++++++++++++---------------- 4 files changed, 49 insertions(+), 31 deletions(-) diff --git a/.gitea/workflows/lint.yaml b/.gitea/workflows/lint.yaml index 681b0a7..3b8e336 100644 --- a/.gitea/workflows/lint.yaml +++ b/.gitea/workflows/lint.yaml @@ -3,7 +3,7 @@ name: lint on: push: branches: - - '**' + - "**" pull_request: workflow_dispatch: @@ -17,11 +17,22 @@ jobs: - 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 -lc 'npx --yes prettier@3 --check --ignore-unknown "$@"' sh "${prettier_files[@]}" ruff: runs-on: [self-hosted, linux, arch, homelab] @@ -74,5 +85,6 @@ jobs: docker run --rm \ -v "$PWD:/work" \ -w /work \ + --entrypoint hadolint \ hadolint/hadolint:latest-debian \ -c .hadolint.yaml "${dockerfiles[@]}" diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 681b0a7..3b8e336 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -3,7 +3,7 @@ name: lint on: push: branches: - - '**' + - "**" pull_request: workflow_dispatch: @@ -17,11 +17,22 @@ jobs: - 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 -lc 'npx --yes prettier@3 --check --ignore-unknown "$@"' sh "${prettier_files[@]}" ruff: runs-on: [self-hosted, linux, arch, homelab] @@ -74,5 +85,6 @@ jobs: docker run --rm \ -v "$PWD:/work" \ -w /work \ + --entrypoint hadolint \ hadolint/hadolint:latest-debian \ -c .hadolint.yaml "${dockerfiles[@]}" diff --git a/cfddns/config.json.example b/cfddns/config.json.example index d290046..c670751 100644 --- a/cfddns/config.json.example +++ b/cfddns/config.json.example @@ -7,7 +7,7 @@ "api_key": { "api_key": "api_key_here", "account_email": "your_email_here" - } + }, "zone_id": "your_zone-id", "subdomains": [ { "name": "", "proxied": true }, diff --git a/headscale/config/policy.json.example b/headscale/config/policy.json.example index a45879f..e280c69 100644 --- a/headscale/config/policy.json.example +++ b/headscale/config/policy.json.example @@ -1,27 +1,21 @@ { - "groups": { - "group:admin": [ - "admin@" - ], - "group:users": [] - }, - "tagOwners": {}, - "hosts": {}, - "acls": [ -{ - "randomizeClientPort": false, - "#ha-meta": { - "name": "users", - "open": true - }, - "action": "accept", - "src": [ - "autogroup:member" - ], - "dst": [ - "autogroup:self:*" - ] - } - ], - "ssh": [] -} \ No newline at end of file + "groups": { + "group:admin": ["admin@"], + "group:users": [] + }, + "tagOwners": {}, + "hosts": {}, + "acls": [ + { + "randomizeClientPort": false, + "#ha-meta": { + "name": "users", + "open": true + }, + "action": "accept", + "src": ["autogroup:member"], + "dst": ["autogroup:self:*"] + } + ], + "ssh": [] +}