The Hatch Act, 5 U.S.C. §§ 7321-7326, restricts certain federal employees from involvement in partisan political activity. Partisan political activity is any activity directed toward the success or failure of a partisan candidate, political party, or partisan political group. Justice Department https://www.justice.gov/jmd/political-activities
Upon employment, employees are given a pamphlet explaining what are restricted activities. Moreover, ignorance of the law is not a defense. In law, ignorantia juris non excusat (ignorance of the law excuses not), or ignorantia legis neminem excusat (ignorance of the law excuses no one), is a legal principle holding that a person who is unaware of a law may not escape liability for violating that law merely by being unaware of its content.
I post because certain employees in favor of Biden and against Trump in 2020 came under scrutiny for engaging in restricted activities.