The incident happened the day prior at a bathroom in the store on Pauline Drive in York Township, York Area Regional Police said.
Police said the suspect approached the victim, made "sexual comments," and attempted to force himself on the victim before fleeing the store on his bicycle.
The suspect was arrested at his home on Thursday. He and the female victim did not know each other before the alleged assault, police said.
The suspect is charged with attempted rape, sexual assault, and indecent assault.
A spokesperson for Giant told Fox News that the safety of its team members and customers "is our priority, and as such, we take incidents like this very seriously."
"We are grateful to the local authorities for their quick work, which resulted in an arrest," the spokesperson said, referring further questions on the matter to police.