Close #3: Improve event-driven repository detection