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
22 lines
703 B
Python
22 lines
703 B
Python
import os
|
|
from scripts.helpers.hacs_manifest import get_hacs_manifest
|
|
|
|
ALTERNATIVES = {
|
|
"info": ["info", "INFO", "info.md", "INFO.md", "info.MD", "INFO.MD"],
|
|
"readme": ["readme", "README", "readme.md", "README.md", "readme.MD", "README.MD"],
|
|
}
|
|
|
|
|
|
def get_info():
|
|
manifest = get_hacs_manifest()
|
|
info = "readme" if manifest.get("render_readme", False) else "info"
|
|
|
|
content = ""
|
|
|
|
for alternative in ALTERNATIVES[info]:
|
|
if os.path.exists(f"/tmp/repositories/addition/{alternative}"):
|
|
print(f"Found info file at /{alternative}")
|
|
with open(f"/tmp/repositories/addition/{alternative}", "r") as alt:
|
|
content = alt.read()
|
|
return content
|