Desertion is a capital offense, but.....
Indeed,
“no punishment” is an authorized punishment for virtually every offense under the UCMJ, and the members are advised of this option in the standard jury instructions. There are two exceptions to this general rule of broad sentencing discretion. The UCMJ prescribes a mandatory sentence for one crime, and a mandatory minimum sentence for two other offenses. Specifically, the UCMJ imposes a mandatory death penalty for a conviction of Article 106, Spies.
Article 106
(c) A person living in occupied territory who, without lurking, or acting clandestinely or under false pretenses, merely reports what is seen or heard through agents to the enemy may be charged under
Article 104 with giving intelligence to or communicating with the enemy, but may not be charged under this article as being a spy.
Article 105 Misconducted as a Prisoner.
Text. “Any person subject to this chapter who, while in the hands of the enemy in time of war—
(1) for the purpose of securing favorable treatment by his captors acts without proper authority in a manner contrary to law, custom, or regulation, to the detriment of others of whatever nationality held by the enemy as civilian or military prisoners
--------------------
......mandatory minimum of a life sentence with the possibility of parole for a violation of Article 118, subsection (1) premeditated murder, or subsection (4) felony murder.
So, only actually spying by Civilians seems to require the Death Penalty as Mandatory.
"Take these 2 out and shoot them."
(6)
Persons not included under “spying”.
(a)
Members of a military organization not wearing a disguise, dispatch drivers, whether members of a military organization or civilians, and persons in ships or aircraft who carry out their missions openly and who have penetrated enemy lines are not spies because, while they may have resorted to concealment, they have not acted under false pretenses.