Skip to main content
Glama
check_last_commit.py2.1 kB
#!/usr/bin/env python3 import subprocess import os from datetime import datetime def get_last_commit_info(): """Get information about the last commit""" try: os.chdir('/workspace') # Get last commit hash and time result = subprocess.run([ 'git', 'log', '-1', '--format=%H|%cd|%s', '--date=iso' ], capture_output=True, text=True, timeout=10) if result.returncode == 0: commit_info = result.stdout.strip() print(f"Last commit info: {commit_info}") # Parse commit info parts = commit_info.split('|') if len(parts) >= 3: commit_hash = parts[0][:8] # First 8 chars commit_time = parts[1] commit_message = parts[2] # Convert timestamp try: commit_dt = datetime.fromisoformat(commit_time.replace('Z', '+00:00')) now = datetime.now() diff_minutes = int((now - commit_dt).total_seconds() / 60) print(f"\n=== LAST COMMIT DETAILS ===") print(f"🔹 Hash: {commit_hash}") print(f"🔹 Time: {commit_dt.strftime('%Y-%m-%d %H:%M:%S UTC')}") print(f"🔹 Message: {commit_message}") print(f"🔹 Minutes ago: {diff_minutes} minutes") if diff_minutes <= 30: print(f"✅ RECENT: Last commit was {diff_minutes} minutes ago") else: print(f"⚠️ OLD: Last commit was {diff_minutes} minutes ago (30+ minutes)") except Exception as e: print(f"Time parse error: {e}") print(f"Raw commit time: {commit_time}") else: print(f"Git log failed: {result.stderr}") except Exception as e: print(f"Error: {e}") if __name__ == "__main__": get_last_commit_info()

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