Assume you have the War Caster feat and can cast single-target spells instead of making an attack of opportunity.
The War Caster feat says:
When a hostile creature’s movement provokes an opportunity attack from you, you can use your reaction to cast a spell at the creature, rather than making an opportunity attack. The spell must have a casting time of 1 action and must target only that creature.
The description of the green-flame blade spell says:
Make a melee attack with a weapon. On hit, the target suffers the attack's normal effects and fire leaps to a different creature you can see within 5 feet of the original target.
If there were no adjacent target, would you allow a player to use this spell instead of an opportunity attack?
If you said yes and there is an adjacent creature, would the player be allowed to forego the secondary damage to use it?