What Causes Sharp Electric Shock Like Pain In The Head?
Peripheral nerve pain more likely, no action needed for now.
Detailed Answer:
I read your question carefully and I understand your concern.
Such short lasting, sharp, electric like pain is typical of neuralgia, pain due to irritation of a peripheral nerve. That would be the most likely cause. However the fact that it passed from one side to the other makes it a little suspicious because nerves are in pairs and usually neuralgia is on one side.
Fortunately the short duration excludes threatening brain conditions like stroke, infections, inflammation, tumors etc. In any of those the headache lasts much longer, for days. The same would go for ear, eye or dental infections or other conditions.
At times anxiety may also be a contributor. It is commonly associated with electrical like scalp pains which do not have any identifiable cause and are completely benign.
As for the feeling of fainting and warmness following the pain. Of course it would be advised to measure your body temperature, if you have a fever that would explain it and add an infection as the possible cause of the pain. If normal though I think it is a question of a vasovagal response or syncope. It is a body reaction in response to intense emotion or pain with slowing of heart rate and dilation of blood vessels in the periphery, leading to the feeling of warmness and fainting. It is very common and benign, doesn't necessitate any intervention.
So for the moment I wouldn't take any action, do not think any tests or medication is needed, only observation. If new symptoms appear do not hesitate to write again.