I think that was the right approach, then again didn't you have through a pull request or at least a code review? Knowing that would give raise to so many "errors" you should have had some sort of communication beforehand.
I don't blame you, more the workflow and ironically the manager
Tbh the fact that they were even ABLE to push something like that without anyone noticing is a red flag for the work environment and workflow.