-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (44 loc) · 1.15 KB
/
Copy pathhacs-validation.yml
File metadata and controls
50 lines (44 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Validate HACS
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
jobs:
hacs:
name: HACS Integration Check
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Prepare HACS manifest for validation
run: |
python - <<'PY'
import json
from pathlib import Path
path = Path("hacs.json")
data = json.loads(path.read_text())
allowed = {
"name",
"content_in_root",
"render_readme",
"country",
"homeassistant",
"zip_release",
"filename",
"persistent_directory",
"source",
}
sanitized = {k: v for k, v in data.items() if k in allowed}
sanitized.setdefault("country", "ALL")
path.write_text(json.dumps(sanitized, indent=2) + "\n")
PY
- name: Run HACS validation
uses: hacs/action@main
with:
category: integration
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}