Slate has a article by Ian Samuel, explaining the legal situation for government employees. Samuel is a lecturer on law at Harvard Law School and a former law clerk for Justice Antonin Scalia. The whole article is worth reading, but the last two paragraphs are the most important ones
Of course, asserting your legal rights and standing up to the government you work for aren’t always easy and come with substantial risks. (For one thing, a court might end up agreeing with the Trump administration that its orders were perfectly lawful.) The wise civil servant who was ready to refuse a Trump executive order would do well to talk with a lawyer beforehand. That’s why I’ve offered to represent, pro bono, any government official who refuses to execute a Trump order on the grounds that the order is illegal. A huge number of other lawyers—in particular, professors Daniel Epps (of Washington University in St. Louis) and Leah Litman (of the University of California–Irvine)—have offered their services as well, as have countless other lawyers, paralegals, law students, legal secretaries, and even (my favorite) a bartender in Cleveland.
No government program or White House command is self-executing. It takes thousands and thousands of people, distributed throughout the country, to transform an illegal order into an injustice. These loyal civil servants were there before President Trump arrived and they will mostly be there when he’s gone. Are you one of them? If so: The American system provides you with a choice. You can insist that you were just following orders. Or you can follow the law.
So, if you are a government employee who think that you have gotten an illegal order, there are resources available for you to draw upon. Please use them.