Voltage regulator with heatsink gets overheated
Put a power resistor between the 12V supply and input to the 7805.

This will transfer the excess wattage from the 7805 to the resistor. 

I used a Yageo 5.1Ω SQP500JB-5R1 resistor for a 12V powered 7805 with a 300 mA load in a product I manufactured for 18 years. No field service issues ever.