From Sahih Bukhari (Hadith 1866):
Narrated `Uqba bin 'Amir:My sister vowed to go on foot to the Ka`ba, and she asked me to take the verdict of the Prophet (ﷺ) about it. So, I did and the Prophet (ﷺ) said, "She should walk and also should ride." Narrated Abul-Khair from `Uqba as above.:
Reference: Bukhari 1866