The Prophet ﷺ said, "Whoever vows to obey Allah, Mighty and Majestic, let him obey Him, and whoever vows to disobey Allah, Mighty and Majestic, let him not disobey Him."
حدثنا عبد الرحمن عن مالك عن طلحة بن عبد الملك عن القاسم
عن النبي ﷺ قال من نذر أن يطيع الله جل وعز فليطعه ومن نذر أن يعصي الله جل وعز فلا يعصه
Its isnad is sahih. Talha bin Abdul-Malik is trustworthy, and his hadith is found in the collections of all except Muslim. Bukhari transmitted the hadith 11/581 no. 6700, Abu Dawud 3/232 no. 3289 in the chapter on oaths, Tirmidhi 3/41 no. 1526, saying it is hasan sahih, and Nasai 7/17 no. 3806, both in the chapter on vows.