OK, the best way of getting GitHub stars is by creating a project that solves real developer problems well.
I assume you have done that already and the metric that people love to hate ⭐ is growing organically.
What do you do now?
I mean you got to ask people in one way or another.
Many companies put it in their navbars or hello bars.
Posthog adds a sticky banner at the bottom of the page that follows you as you scroll.
It also shows a start count which at their size (11k + stars) acts as social proof.
You can close it and the next time you visit the page it will be off not to push too much.
I like the concept makes sense to test it out this way imho.