The Messenger of Allah ﷺ was on Mount Hira along with Abu Bakr and Umar, Ali, Uthman, Talha, and Zubayr when the rock began to shake. The Prophet ﷺ said, "Be still, for upon you is none but a prophet, a truthful one, or a martyr."
حدثنا قتيبة بن سعيد حدثنا عبد العزيز بن محمد عن سهيل بن أبي صالح عن أبيه
أن رسول الله ﷺ كان على حراء هو وأبو بكر وعمر وعلي وعثمان وطلحة والزبير فتحركت الصخرة فقال النبي ﷺ اهدأ إنما عليك نبي أو صديق أو شهيد
Muslim also narrated it in the Book of the Virtues of the Companions, chapter on the virtues of Talha and Zubayr , hadith 2417, from Qutayba, with the same wording.On this subject there are also narrations from Uthman [to come 3699], Saeed bin Zayd [to come 3757], Ibn Abbas [Ibn Abu Asim in Sunnah, hadith 144, and Tabarani in Kabir 11/259, hadith 11671], Sahl bin Saad [Abdul-Razzaq 11/229, hadith 2001, and from him Ahmad 5/331], Anas bin Malik [to come 3697], and Burayda Aslami [Ahmad 5/346].