Oven won't stay lit

When the oven lights the ignitor continues to click and after 2 second the flame and ignitor shuts off. Should I replace the burner, ignitor or both?