the Messenger of Allah (ﷺ) heard him swearing by his father. The Messenger of Allah (ﷺ) said: 'Allah forbids you from making oaths by your forefathers." 'Umar said: I never took an oath by them (i.e., my forefathers) myself nor narrating such words from anyone else.”
Sunan Ibn Majah Book 11, Hadith 5