Deuteronomy 17:3
2 Suppose a man or woman is discovered among you in one of your villages that the Lord your God is giving you who sins before the Lord your God and breaks his covenant 3 by serving other gods and worshiping them—the sun, moon, or any other heavenly bodies that I have not permitted you to worship. 4 When it is reported to you and you hear about it, you must investigate carefully. If it is indeed true that such a disgraceful thing is being done in Israel, 5 you must bring to your city gates that man or woman who has done this wicked thing—that very man or woman—and you must stone that person to death.
Jeremiah 8:2
1 The Lord says, “When that time comes, the bones of the kings of Judah and its leaders, the bones of the priests and prophets, and of all the other people who lived in Jerusalem will be dug up from their graves. 2 They will be spread out and exposed to the sun, the moon, and the stars. These are things they adored and served, things to which they paid allegiance, from which they sought guidance and worshiped. The bones of these people will never be regathered and reburied. They will be like manure used to fertilize the ground.
Notes and References
"... The reference to astral bodies as the object of illicit worship is found once in Deuteronomy proper (17:3). Within the compass of the history, it occurs five times, all in places which have been considered secondary to the basic compilation: Deuteronomy 4:19; 2 Kings 17:16; 21:3, 5: 23:4, 5. It is also found in Jeremiah 8:2 and 19:13 and Zephaniah 1:5. With this expression and example 13, the net of usage has been extended to include the judgment on Manasseh in 2 Kings 21, a sermonic judgment that must belong to a writer after the time of Josiah and which must be the exilic editor if our thesis is correct ..."
Nelson, Richard D. The Double Redaction of the Deuteronomistic History (p. 59) JSOT Press, 1981