Bankruptcy is a legal right of anyone in the US, and will not affect your green card residency status. If your financial situation makes you "likely to become a public charge," it could be difficult for you to sponsor someone for residency in the future. However, the bankruptcy by itself will not have that affect.
The reason why you file bankruptcy may affect your immigration proceedings.
For example, if you are filing for bankruptcy because of gambling debts, that may bring into question your moral character. If you are filing bankruptcy, for example, because of business debts, that should not affect your immigration proceeding.
You should make sure your attorney understands that you are a permanent resident so that the attorney can check that the information on the bankruptcy documents does not negatively affect you.