I love a little bash script as much as anyone, but the official GitHub CLI is a better choice here, as it handles authentication with the API much more smoothly. Even if you just used it to make authenticated API calls, it’d be preferable to curl.
You also don’t have any error handling.