Preheat the oven to 200°C (400°F).
In a skillet, heat a small amount of oil over medium heat and sauté the onions and garlic until softened.
In a mixing bowl, combine the cooked onions and garlic with the pork sausage meat and rosemary. Season with salt and pepper, then mix until well incorporated.
Roll out the puff pastry on a lightly floured surface and cut it into large rectangles.
Place a generous spoonful of the sausage mixture onto one end of each pastry rectangle and roll it up.
Seal the edges with the beaten egg and place the rolls seam-side down onto a baking tray lined with parchment paper.
Brush the tops with the remaining beaten egg to achieve a golden finish.
Bake in the preheated oven for 20–25 minutes until golden brown and cooked through.
Remove from the oven and let cool for a few minutes before serving warm.