Worms eating my garlic scapes. How can I get rid of them?

small little yellow worm are eating my garlic scypes and leaving residue that i believe are eggs.how can i get rid of them and will they get to the bulb.