An apparatus has a green compact electrode including a material of a coating formed on a workpiece by a discharge, a power source for supplying a first voltage, a voltage detector for detecting a voltage between the workpiece and the electrode, and a pulse current generator for generating and outputting a pulse current from the first voltage, and for cutting off the output when a predetermined period of time has passed after the voltage is detected to be less than a detection voltage. The pulse current is supplied between the workpiece and the electrode, and the detection voltage is less than the first voltage by 5% to 20% of the first voltage.