Tough place...

So me and my ex broke up about two months ago.. it’s been messy as in we broke up but had sex a few more times and emotions are just crazy and we argue and then we are fine ect.. basically we can’t leave each other alone well recently we just got back on good terms and idk ..night potentially think about getting back together. Spent some time cause he was going through a hard time. It was nice. But I made a stupid decisión a few weeks ago and slept with someone ...it was an in the moment and kind of a way for me to block out the negative emotions and I regretted it immediately. So my question is I guess do I need to tell my ex..? I feel bad about it honestly but at the same time is it something g that he needs to know. Thanks!