There was decent movie about this, "The Execution of Private Slovik" which was a true story of a WW II American soldier who was executed.
Damn ... just googled it, and it was in 1974 .... fuck I feel old now.
It starred Martin Sheen and a very young Charlie Sheen had a bit part, but I cannot recall him being in it...... must be my age.