If you can get a ride to Whitney Portal public transportation can get you to Yosemite Valley, as long as you’re not in a rush.
From the Portal you can walk or hitch hike down to Lone Pine. From there we took the Eastern Sierra Transit bus to Bishop, and then transferred to another bus to Mammoth Lakes. Depending on what time you arrive in Mammoth you’ll probably have to wait till the next day to catch one of Yosemite National Park’s shuttles. Their YARTS bus system has shuttles that drive all the way down to Mammoth twice a day during peak season, at the time of this writing (they stop service around Labor Day Weekend). This bus can get you all the way to Yosemite Valley.
If you already have permits you can pick them up at the Wilderness Office in the valley. If you didn’t reserve a permit, like we didn’t, that’s where things get tricky. In any case, if you’re trying for a walk-in permit, know that they are in high demand and it may take a day or two to secure one during peak season.