God told Israel to take their oaths in His name.
Through Moses, GOD told Israel to take all of their oaths in His name and not the name of other gods:
13 You shall fear the Lord your God and serve Him, and you shall cling to Him and take oaths in His name. 14 You shall not go after different gods, the gods of the nations around you, 15 because the Lord your God is a jealous God among you, lest the anger of the Lord your God be aroused against you and destroy you from the face of the earth.Deuteronomy 6:13-15 OSB
The Law of Moses did not forbid taking oaths as is commonly believed.