2 quotes from the Muslim tradition:
If a [person] plants a tree or sows seeds, and then a bird, a person or an animal eats from it, it is regarded as a charitable gift for him until the Day of Judgment.
Even if the Last Day befalls one of you while he has in his hand a sapling, let him plant it.
———Prophet Muhammad