The Posse Comitatus Act and Immigration  has been argued about  before

"In 2010, former President Barack Obama said he would deploy 1,200 National Guard troops to the U.S.-Mexico border. They were sent to Arizona, Texas, California and New Mexico. While National Guard troops were not authorized to arrest people found to be crossing the border illegally, they helped staff observation posts, monitor surveillance footage and build fences. 

In 2006, former President George W. Bush called up 6,000 National Guard troops to California, Arizona, New Mexico and Texas. They were commissioned to help install border barriers, provide training and assist with border surveillance."

As long as they aren't actually arresting the illegal criminals, it is irrelevant.