Should I Take a Full-Time Engineering Job Knowing I’ll Leave in 5 Months?

I recently received a full-time offer as a mechanical engineer at a defense/aerospace company. The role could potentially lead to security clearance, and the experience is solid, but I know for sure that I’ll be leaving in August to start my master’s program.

I’m mainly considering this job for the money since it would give me a steady income for a few months. My concern is whether it’s ethical (or practical) to accept a full-time role without disclosing my short-term plans. Would this burn bridges? Should I just keep quiet and leave when the time comes or be upfront? Has anyone else done something similar? Curious to hear thoughts and experiences.