The Messenger of Allah ﷺ would fast until we said he would never break his fast, and he would break his fast until we said he would never fast. He never fasted an entire month consecutively, except Ramadan, from the time he arrived in Madinah.
حدثنا محمد بن بشار حدثنا محمد بن جعفر حدثنا شعبة عن أبي بشر عن سعيد بن جبير
كان رسول الله ﷺ يصوم حتى نقول لا يفطر ويفطر حتى نقول لا يصوم وما صام شهرا متتابعا إلا رمضان منذ قدم المدينة
Bukhari narrated it in Sawm, chapter on what is mentioned regarding the fasting and breaking of fast of the Prophet ﷺ, h: 1971, and Muslim in the previous chapter, h: 1157, from the hadith of Abu Bishr, through this route.