Nonetheless, there are many examples in Scripture where the leaders of the nation renewed the covenant with God by taking an oath to govern according to His law.
One of the clearest examples, was during the time of Nehemiah when all of the leaders agreed to a written oath:
"Now because of all this We are making an agreement in writing; and on the sealed document are the names of our leaders, our Levites and our priests.... (Neh 9:38)
"....are joining with their kinsmen, their nobles, and are taking on themselves a curse and an oath to walk in God's law...." (Neh 10:29).
Another example is II Kings 23:2,3 where king Josiah renewed the covenant: "And the king stood by the pillar and made a covenant before the Lord, to walk after the Lord, and to keep His commandments.."
There are many other examples. The original covenant occurred at Ex. 24:7 when all the people of Israel stood before God and promised: "All that the Lord has spoken we will do and we will be obedient."
This does not imply that the Old Testament required works salvation, but rather that the nation was obligated to obey the law of the King in its judicial proceedings.
This national oath is, in fact, central to our Great Commission of making disciples of all cultures (ethnos - Mt. 28:19,20). God instructs the nations around Israel in Jer. 12:16 that "...it will come about that if they will really learn the ways of my people to swear by My name, 'As the Lord lives,' even as they taught My people to swear by Baal, then they will be build up in the midst of My people."
Thus, you are correct to condemn any swearing by Baal (government god), but the true God requires that the nations swear allegiance to Him.