Cook the onion in half the oil until soft but not coloured. Add the spices and stir over a low heat for 1 minute.
Add the pumpkin and sweet potato and stir to coat the pieces. Add 200ml water, cover and simmer for 10 minutes or until tender. Remove the lid and cook until almost all the liquid has evaporated. Cool and season.
Preheat the oven to 190C/170C Fan/Gas 5. Line two baking trays with baking paper. Cut each sheet of pastry in half to make two long strips. Put one on a work surface and brush lightly with oil. Keep the rest covered with a damp tea towel so that it doesn't dry out.
Put 2tbsp of pumpkin mixture at one end and fold over the corner to make a triangle. Then fold over again in the opposite direction. Continue folding until all the pastry is used. Put on a baking tray and brush with oil.
Repeat using the rest of the pastry and filling to make another 11 samosas.
Bake for 20-25 minutes or until golden. Serve hot or cold.