Melt the butter in a 2-quart saucepan over medium heat. Add the shallot and saute until tender. Add the rice and stir until the rice is glossy and coated with the butter. Season with salt and pepper.
Add the stock, garlic and thyme. Cover with a tight fitting lid. Cook 40 minutes, turn off the heat and let sit for 10 minutes.
Remove the thyme sprigs and garlic. Fluff with a fork and add parsley and green onions.