Microswitch debouce circuit plus high impedance points - case study
You don't need a transistor to do the de-glitch; just use a potential divider to pot down 12v to something like 3V. A 4:1 divider will work using a 1Mohm and a 330k resistor (attenuation converts 12V to 2.98 volts). Then put a 1 uF (or 2uF) across the 330k.

If there's any possibility that the 12V is higher maybe have a protection diode to Vss from the resistor junction. If you have a regulated 12V then all should be fine.