The ACM Code of Ethics and Professional Conduct has been around for a while and surely is a good start. But if you read through it, you'll quickly come to the conclusion that unless leadership buys into it your only real option is to quit your job if asked to do something you shouldn't.
That's the whole point of a professional code of ethics. If you want to protect people for behaving ethically, that's government's job (c.f. whistleblower laws et. al.).
This sits a layer down in the defense-in-depth stack. And the idea is that if there's a recognized code, and consensus on what constitutes a violation, that employers will conform because if they don't they'll risk not just one "activist" employee leaving but most of them, out of a shared sense of communal ethics.
Would it work? No idea. My experience is that software people tend to be pretty squishy on matters of personal ethics.
They don't want to alienate Chinese members so they go to great lengths to prevent the code of conduct from outright prohibiting participation in the creation of things like the systems used to control and oppress the Uyghurs, etc.
https://www.acm.org/code-of-ethics