Keep single public stash config and add temporary Nekobox import copy #94
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Config Validation | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Install dependencies | |
| run: | | |
| python3 -m pip install --upgrade pip | |
| pip3 install pyyaml requests | |
| - name: Basic file checks | |
| run: | | |
| test -f stash/Stash-v4-public-airport.yaml | |
| test -f stash/Stash-v4-public-airport-android.yaml | |
| test -f custom-rules/My-Crypto.list | |
| test -f custom-rules/My-Finance-Direct.list | |
| test -f custom-rules-clash/My-Crypto.yaml | |
| test -f custom-rules-clash/My-Finance-Direct.yaml | |
| echo "Basic files check passed" | |
| - name: YAML syntax check | |
| run: | | |
| python3 - <<'PY' | |
| import yaml | |
| for path in [ | |
| 'stash/Stash-v4-public-airport.yaml', | |
| 'stash/Stash-v4-public-airport-android.yaml', | |
| 'custom-rules-clash/My-Crypto.yaml', | |
| 'custom-rules-clash/My-Finance-Direct.yaml', | |
| ]: | |
| with open(path, encoding='utf-8') as f: | |
| yaml.safe_load(f) | |
| print('YAML OK:', path) | |
| PY | |
| - name: Duplicate rule check (active custom lists) | |
| run: | | |
| python3 - <<'PY' | |
| from collections import Counter | |
| from pathlib import Path | |
| for rel in ['custom-rules/My-Crypto.list', 'custom-rules/My-Finance-Direct.list']: | |
| p = Path(rel) | |
| lines = [] | |
| for raw in p.read_text(encoding='utf-8').splitlines(): | |
| s = raw.strip() | |
| if not s or s.startswith('#'): | |
| continue | |
| lines.append(s) | |
| c = Counter(lines) | |
| dup = [k for k, v in c.items() if v > 1] | |
| if dup: | |
| print(f'Duplicate rules found in {rel}:') | |
| for k in dup: | |
| print(f'- {k} (x{c[k]})') | |
| raise SystemExit(1) | |
| print(f'No duplicate rules in {rel} (total={len(lines)}, unique={len(c)})') | |
| PY | |
| - name: Run local validation script | |
| run: | | |
| bash scripts/validate-local.sh | |
| - name: Summary | |
| run: echo "Validation passed" |