When to tell work?

Megan
Hello! I am a first time mom and I am nervous about telling my new job that I am pregnant. I found out about as week into starting it and will not qualify for maternity leave until I have been there for a year. I will also be in my probationary period until July. When should I tell my boss? How do I tell them? I was thinking of going to my HR department first to come up with a plan before I go to my boss. Is that the right thing to do? Thank you.