What do you do when he has a baby on you?

Please no harsh judgement. My boyfriend and I have been going through some tough issues. I recently found out he got another woman pregnant and she had the baby. I didn’t find out until she was about 5 months when I answered his phone and then she started posting about it to let me know. She knew about our relationship and kept seeing him (no clue why he or her would do this). He says he wants to be with me and messed up. We don’t have kids, he has two kids with someone else and now this third child with the girl he cheated on me with. Not sure what to think. I get it we all make mistakes, but would I be an idiot to stay with him? Anyone ever gone through this? Does it work? Thanks!