A win over the Padres on Monday night punched the ticket for San Francisco