Abbas asked permission from the Messenger of Allah ﷺ to spend the nights of Mina in Mecca on account of his duty providing water to the pilgrims, and he granted him permission.
حدثنا عثمان بن أبي شيبة حدثنا ابن نمير وأبو أسامة عن عبيد الله عن نافع
استأذن العباس رسول الله ﷺ أن يبيت بمكة ليالي منى من أجل سقايته فأذن له
Bukhari narrated it in the book of Hajj, chapter, "May those in charge of providing water, or others, spend the nights of Mina in Makkah?", hadith no. 1745, and Muslim in the book of Hajj, chapter on the obligation of spending the nights of the days of Tashriq in Mina, etc., the rites, hadith no. 1315, from the hadith of Ibn Numayr through this route. See also hadith no. 2025.