This problem is related to solder joints on the wiper control circuit board.
A temporary fix may be to install a separate ground from the motor body to the truck body.This will only work if only the ground pin is broken loose. Try touching a wire to these pieces to see if you can get it working until you can get it soldered.
The board is located inside the wiper motor assembly behind the cover shown here-
Remove the three screws holding the circuit board cover. Remove screw A, and just loosen B and C, since the corners are slotted, rather than holes. They are Torx head.
When the cover is removed, the circuit board is visible.The board can simply be lifted out with careful prying around the edges.
The circuit board comes free, with the black cable connector socket attached to it. Lift the plastic catch on the plug up to disconnect the cable.
The above picture has solder joints with cracks in them circled. All of them where the black electrical connector socket prongs come through the board were bad. The stress of the electrical connection and some rough handling may contribute to the loose joints here.
Here are closeups of some cracked joints.
One cause of the cracks may be that these soldered prongs act as support for the wiring socket. There are two extra plastic support pins that come through the board, but these aren't very effective. On the wiper board, the resoldering is the best fix, even the new boards you get from GM may have dry solder joints.