This is how Ronald Reagan was elected President of the Screen Actors Guild in 1947 even though, by then, he wasn't getting much work in Hollywood.
Several avowed Communists worked to take him down from the get-go. The first actor to step forward and support him in public (not just in a secret ballot election) was the legendary John Wayne. After that, more slowly came forward so that, by 1950, congress was actually holding hearing on the Communist intimidation in Hollywood which, much later, evolved into the McCarthy hearings.
The next time some liberal dirtbag denounces Joe McCarthy, just remind them what their thugs were doing in Hollywood long before McCarthy was elected to the U.S. Senate.
Fast-forward to today, the only thing that's changed is that it's now they're called "Democrats".
McCarthy had nothing to do with HUAC. It was a House commitee which was off and running in 1947, years before he ever mentioned communism.
Hollywood still suffers. Not easy to get an acting job if you are a republican. Many keep quiet just to have work.