Answering your question, the Resident Fatwa Committee (RFC) of AMJA states:
The Assembly of Muslim Jurists in America (AMJA) advises that whenever there is a need for such masks and alternative masks that do not require shaving are unavailable or less effective, then it would be permissible to trim the beard to the extent that would make proper fitting possible in order to avoid Coronavirus (COVID-19).
If this is not achieved by trimming, then leaving a goatee would be the next option, as some physicians were advised. If leaving a goatee too prevented proper mask fitting, then shaving the beard is permissible for this extraordinary indication, to prioritize the sacredness of life and prevent harm to oneself or others.
May the blessings of Allah be on His last Messenger, and all praise belongs to the Lord of the Worlds.
Almighty Allah knows best.