Skip to main content
Glama
force_push_fix.py2.92 kB
#!/usr/bin/env python3 import subprocess import os import sys from datetime import datetime def check_and_push_changes(): """Check git status and push changes if needed""" try: os.chdir('/workspace') print("🔍 Checking current git status...") # Check if there are any changes result = subprocess.run(['git', 'status', '--porcelain'], capture_output=True, text=True, timeout=10) if result.returncode != 0: print(f"❌ Git status failed: {result.stderr}") return False changes = result.stdout.strip() if changes: print("📝 Changes detected:") print(changes) # Stage changes print("\n📦 Staging changes...") result = subprocess.run(['git', 'add', '.'], capture_output=True, text=True, timeout=10) if result.returncode != 0: print(f"❌ Git add failed: {result.stderr}") return False # Commit changes print("\n💾 Committing changes...") commit_msg = "Fix auth middleware - make /auth/generate-token endpoint public for external access" result = subprocess.run(['git', 'commit', '-m', commit_msg], capture_output=True, text=True, timeout=10) if result.returncode != 0: print(f"❌ Git commit failed: {result.stderr}") print(f"Commit output: {result.stdout}") return False print("✅ Changes committed successfully") else: print("ℹ️ No changes to commit") # Push to GitHub print("\n🚀 Pushing to GitHub...") result = subprocess.run(['git', 'push', 'origin', 'main'], capture_output=True, text=True, timeout=30) if result.returncode == 0: print("✅ Successfully pushed to GitHub!") print("Railway should auto-deploy within 2-3 minutes") return True else: print(f"❌ Git push failed: {result.stderr}") print(f"Push output: {result.stdout}") return False except subprocess.TimeoutExpired: print("⏰ Command timed out") return False except Exception as e: print(f"❌ Error: {e}") return False if __name__ == "__main__": success = check_and_push_changes() if success: print("\n🎉 SUCCESS! Changes pushed to GitHub.") print("Railway will auto-deploy your fix in 2-3 minutes.") else: print("\n⚠️ PUSH FAILED! Manual push may be needed.") sys.exit(0 if success else 1)

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Pritrj/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server