mirror of
https://github.com/alexhopeoconnor/default.git
synced 2026-10-19 09:21:32 +10:00
Add preflight (#490)
* 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
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import os
|
||||
import json
|
||||
|
||||
|
||||
def get_event():
|
||||
with open(os.getenv("GITHUB_EVENT_PATH"), "r") as event_data:
|
||||
event = json.loads(event_data.read())
|
||||
|
||||
return event
|
||||
@@ -5,7 +5,7 @@ from glob import glob
|
||||
|
||||
def get_hacs_manifest():
|
||||
files = []
|
||||
for dir, _, _ in os.walk("/tmp/addition"):
|
||||
for dir, _, _ in os.walk("/tmp/repositories/addition"):
|
||||
files.extend(glob(os.path.join(dir, "*hacs.json")))
|
||||
|
||||
if len(files) != 1:
|
||||
@@ -13,7 +13,9 @@ def get_hacs_manifest():
|
||||
exit(1)
|
||||
|
||||
hacs_manifest = files.pop()
|
||||
print(f"Found HACS manifest at {hacs_manifest.replace('/tmp/addition','')}")
|
||||
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())
|
||||
|
||||
@@ -14,8 +14,8 @@ def get_info():
|
||||
content = ""
|
||||
|
||||
for alternative in ALTERNATIVES[info]:
|
||||
if os.path.exists(f"/tmp/addition/{alternative}"):
|
||||
if os.path.exists(f"/tmp/repositories/addition/{alternative}"):
|
||||
print(f"Found info file at /{alternative}")
|
||||
with open(f"/tmp/addition/{alternative}", "r") as alt:
|
||||
with open(f"/tmp/repositories/addition/{alternative}", "r") as alt:
|
||||
content = alt.read()
|
||||
return content
|
||||
|
||||
@@ -5,7 +5,7 @@ from glob import glob
|
||||
|
||||
def get_integration_path():
|
||||
files = []
|
||||
for dir, _, _ in os.walk("/tmp/addition"):
|
||||
for dir, _, _ in os.walk("/tmp/repositories/addition"):
|
||||
files.extend(glob(os.path.join(dir, "*manifest.json")))
|
||||
|
||||
if len(files) != 1:
|
||||
|
||||
Reference in New Issue
Block a user