Preheat the oven to 375°F (190°C). Line a baking sheet with parchment paper.
Make the filling: heat olive oil in a small skillet over medium heat. Sauté the onion until softened, 3–4 minutes. Add spinach and cook just until wilted (or warmed through if using frozen). Let cool slightly.
In a bowl, combine the spinach mixture, crumbled feta, beaten egg, black pepper, and (if needed) a small pinch of salt. Mix until evenly combined.
Unroll the phyllo and keep it covered with a damp towel while you work so it doesn’t dry out. Place 1 sheet on a clean surface and brush lightly with melted butter. Top with a second sheet and brush again.
Cut the stacked phyllo into 3-inch-wide strips. Place a heaping spoonful of filling at one end of each strip.
Fold the corner over the filling to form a triangle, then continue folding like a flag until you reach the end of the strip. Brush the seam with a little butter and place seam-side down on the baking sheet.
Repeat with remaining phyllo and filling. If needed, re-melt butter and keep brushing lightly between layers for maximum flakiness.
Whisk egg yolk with milk and brush over the tops. Sprinkle with sesame seeds, nigella seeds, and Aleppo pepper (if using).
Bake 25–30 minutes, until deeply golden and crisp. Cool for 5 minutes before serving warm.