Phase 4: The Cybernetic Nervous System & Thermodynamic Orchestration
This commit is contained in:
1 parent
4be0958758
commit
e5c6e17140
45 files changed
+4486
-742
No files matched your search
@@ -0,0 +1,37 @@
|
||||
import os
|
||||
import requests
|
||||
import sys
|
||||
|
||||
def submit_issue(title, body_file):
|
||||
token = os.environ.get("GITHUB_TOKEN")
|
||||
if not token:
|
||||
print("Error: GITHUB_TOKEN environment variable not set.", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
with open(body_file, "r") as f:
|
||||
body = f.read()
|
||||
|
||||
url = "https://api.github.com/repos/mrhavens/becomingone/issues"
|
||||
headers = {
|
||||
"Authorization": f"token {token}",
|
||||
"Accept": "application/vnd.github.v3+json"
|
||||
}
|
||||
data = {
|
||||
"title": title,
|
||||
"body": body
|
||||
}
|
||||
|
||||
response = requests.post(url, headers=headers, json=data)
|
||||
if response.status_code == 201:
|
||||
print(f"Successfully created issue: {response.json()['html_url']}")
|
||||
else:
|
||||
print(f"Failed to create issue. Status: {response.status_code}", file=sys.stderr)
|
||||
print(response.text, file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) != 3:
|
||||
print("Usage: python submit_issue.py <title> <body_file>", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
submit_issue(sys.argv[1], sys.argv[2])
|
||||
Reference in new issue
Block a user