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
28 lines
557 B
Python
28 lines
557 B
Python
import json
|
|
from scripts.changed.category import get_category
|
|
|
|
DEFAULT = "/tmp/repositories/default"
|
|
|
|
|
|
def get_repo():
|
|
category = get_category()
|
|
with open(f"{DEFAULT}/{category}", "r") as default:
|
|
current = json.loads(default.read())
|
|
|
|
with open(category, "r") as default:
|
|
new = json.loads(default.read())
|
|
|
|
for repo in current:
|
|
if repo in new:
|
|
new.remove(repo)
|
|
|
|
if len(new) != 1:
|
|
print(f"Bad data {new}")
|
|
exit(1)
|
|
|
|
return new.pop()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
print(get_repo())
|