The mortgage itself is an instrument that creates a mortgage lien on a property. A note and mortgage contract would have been signed by the mortgagor (owner of real estate) in exchange for some type of financial arrangement by the mortgagee (lien holder).
Since your name is on title and not on the loan, the mortgagee, or holder of the lien, is using the process of foreclosure to exercise the lien to force the sale of the property to satisfy said lien. The actual foreclosure should not have any direct impact to your credit, since you are not on the mortgage. The mortgage created a lien on the property.
But since your name is on title to the property in question, if there are any other unsatisfied liens or financial on the property, your credit might be adversely impacted, such as for unpaid property taxes, judgment, or a mechanic’s lien. Any excess proceeds from the foreclosure sale would legally pass to the mortgagor (owner of real estate) and any other owners on title, after full satisfaction of any other subordinate liens, if any.