The Messenger of Allah ﷺ would not launch a military campaign during the sacred months unless he was attacked or under threat of attack. If a sacred month came upon him while on campaign, he would halt until it had passed.
حدثنا إسحاق بن عيسى حدثنا ليث بن سعيد عن أبي الزبير
لم يكن رسول الله ﷺ يغزو في الشهر الحرام إلا أن يغزى أو يغزوا فإذا حضره أقام حتى ينسلخ