So far, all the sites I've found are talking about city ordinances against gardening, not HOA bylaws.
However, an HOA cannot legally enforce a rule that contradicts a state law. The worst HOAs will still try to enforce illegal rules. Which means you have to sue the HOA.
Genuinely curious, as in my country HOAs are a bit less powerful, but: wouldn't it be the other way around? If the HOA fines you for things that are legal within state law, and you refuse to pay, don't they need to sue you to get you to pay(or to try to get your home, which I heard is sometimes an option)? Or do you really need to sue them?
HOA aren't governmental organizations, they are contractual organizations which makes it more complicated than something like a municipal government. They are private entities more akin to a nonprofit corporations than a government. It will really depend on the language of the law. If it actually guarantees the right to grow a garden then it should override HOA rules, if it just restricts lower levels of government from banning gardens then it is unlikely to affect HOA rules.