Preheat the oven to 375°F (190°C).
Cook the pasta according to package instructions until al dente. Drain and set aside.
In a large skillet, heat olive oil over medium heat and sauté the onions until translucent, about 5 minutes.
Add minced garlic and cook for an additional minute until fragrant.
Stir in the pumpkin puree and diced tomatoes, along with the oregano, basil, salt, and pepper. Simmer for 10 minutes.
Mix the cooked pasta into the sauce until well combined.
Transfer the pasta mixture to a greased baking dish. Sprinkle the top with mozzarella and Parmesan cheese.
Bake for 25–30 minutes, or until the cheese is bubbling and golden brown.
Let it cool for a few minutes before slicing and serving.