summary refs log tree commit diff stats
path: root/github/output.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xgithub/output.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/github/output.py b/github/output.py
new file mode 100755
index 00000000..6d64d71d
--- /dev/null
+++ b/github/output.py
@@ -0,0 +1,16 @@
+from os import path, makedirs
+
+def write_file(file_path : str, string : str) -> None:
+    makedirs(path.dirname(file_path), exist_ok = True)
+    with open(file_path, "w") as file:
+        file.write(string)
+
+def output_issue(issue : dict) -> None:
+    try:
+        if 'documentation' in issue['labels']:
+            write_file(f"issues/documentation/{issue['id']}", issue['title'] + '\n' + (issue['description'] or ""))
+        else:
+            write_file(f"issues/{issue['id']}", issue['title'] + '\n' + (issue['description'] or ""))
+    except TypeError:
+        print(f"error with bug {issue['id']}")
+        exit()