mirror of
https://github.com/alexhopeoconnor/default.git
synced 2026-10-04 02:58:10 +10:00
* Add preflight * fix syntax * move check * get event * print * return event * use path * tt * move to helper * add issue_comment * remove should run * check owner * add more information to the logs * test * add finished * move keys * Update errors * remove repo * fix JQ run * filter
24 lines
542 B
Python
24 lines
542 B
Python
import json
|
|
import os
|
|
from glob import glob
|
|
|
|
|
|
def get_hacs_manifest():
|
|
files = []
|
|
for dir, _, _ in os.walk("/tmp/repositories/addition"):
|
|
files.extend(glob(os.path.join(dir, "*hacs.json")))
|
|
|
|
if len(files) != 1:
|
|
print("No HACS manifest")
|
|
exit(1)
|
|
|
|
hacs_manifest = files.pop()
|
|
print(
|
|
f"Found HACS manifest at {hacs_manifest.replace('/tmp/repositories/addition','')}"
|
|
)
|
|
|
|
with open(hacs_manifest, "r") as mf:
|
|
hacs_manifest = json.loads(mf.read())
|
|
|
|
return hacs_manifest or {}
|