I heard that in Russian, the diminutive short form of girl names often ends in "а" or "ка", but how do the diminutive short forms (I don't mean the endearing form) of male names work? Does the short form of a boy's name also have a similar pattern in Russian? I've tried to Google it, but I didn't really find anything helpful.
Short answer: No. Nor is there a definite rule for diminutives for girls' names. Your rule of -a and -ka may be more frequently used to derive diminutives from nouns.
Additional information: I think there is a bit of a misunderstanding with diminutives here. There is no such thing as a 'diminutive short form' for names. There are, however, just diminutives. Unlike in English, diminutives are not used for the sake of shortening a name. They are used to express different emotions or endearment. I know you put 'not the endearing form' in your question, but it's worth noting that forms other than the endearing form do exist.
In the case of many Russian names, the number of diminutives is quite large. Take Александр; Сашенька could be considered a diminutive. It means something along the lines of маленькая Cаша, or 'Little Sasha'. Саша on its own is also a diminutive used with close friends, whereas Сашенька is a bit more common with parents. This is just to illustrate to you the vast number of forms and usages in the case of diminutive names. Александрa is the female form of the Александр, but it also has the friendly diminutive Саша. Here the male and female forms are the same.
Now take the name Екатерина. This is one of the names where I could find a bit more than just the endearing form clearly listed in one spot on the web. There's Катя, which is a friendly, not necessarily endearing form used by friends and colleagues. Катенка is endearing, but there is also Катка, which can be considered derogatory and even insulting.
Through these examples, you can see there's no limit to the rules governing diminutives, since there is no such thing as a 'short form' of a name in Russian - only diminutives to express feelings. And in this realm, there is no definite rule.
Links I used that you may find helpful: A page with naming conventions, including extensive examples of diminutives: https://tvtropes.org/pmwiki/pmwiki.php/UsefulNotes/RussianNamingConvention A page with some tips on grammatical noun diminutives, which you may find helpful to expand on the rule of -a and -ka which you're already familiar with: https://www.russiantutoring.com/post/russian-diminutive-suffixes-what-do-you-need-to-know
Hope you find this helpful.