feat: expand MCP server tools for PR and label management, add helper CLI scripts
Closes #7
This commit is contained in:
Executable
+39
@@ -0,0 +1,39 @@
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Auto-execute using the project's local virtual environment Python
|
||||
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
|
||||
venv_python = os.path.join(PROJECT_ROOT, "venv", "bin", "python3")
|
||||
if os.path.exists(venv_python) and sys.executable != venv_python:
|
||||
os.execv(venv_python, [venv_python] + sys.argv)
|
||||
|
||||
from gitea_auth import get_auth_header, api_request
|
||||
|
||||
def try_repo(host, org, repo):
|
||||
print(f"Checking repo: {host}/{org}/{repo}...")
|
||||
try:
|
||||
auth = get_auth_header(host)
|
||||
if not auth:
|
||||
print(f" No auth header found for {host}")
|
||||
return
|
||||
url = f"https://{host}/api/v1/repos/{org}/{repo}/pulls?state=open"
|
||||
prs = api_request("GET", url, auth)
|
||||
if not prs:
|
||||
print(" No open pull requests.")
|
||||
for pr in prs:
|
||||
print(f" PR #{pr['number']}: {pr['title']}")
|
||||
print(f" Branch: {pr['head']['ref']} -> {pr['base']['ref']}")
|
||||
print(f" URL: {pr['html_url']}")
|
||||
print(f" Mergeable: {pr.get('mergeable')}")
|
||||
except Exception as e:
|
||||
print(f" Error: {e}")
|
||||
|
||||
def main():
|
||||
try_repo('gitea.dadeschools.net', '913443', 'eAgenda')
|
||||
try_repo('gitea.dadeschools.net', 'Contractor', 'eAgenda')
|
||||
try_repo('gitea.prgs.cc', '913443', 'eAgenda')
|
||||
try_repo('gitea.prgs.cc', 'Scaled-Tech-Consulting', 'eAgenda')
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user