No no no no no no no, please no. Under no circumstances is that OK.
If the enemy is in a group of civilians, you use the police, arrest them, put them for a trial and send to prison.
If the enemy is in a group of civilians, and your immediate action is to bomb them along with the civilians, then you don’t value the lives of those civilians. At best you don’t care whether those civilians are alive or dead, and at worst you actually want those civilians dead. In the former case, you are doing a war crime, a crime against humanity, in the latter case you are doing a genocide and using the enemy as an excuse or justification.
In any case, there are plenty of ways to get around that. Unless the mass casualty is the point.