Not really sure what you're talking about. Not everything you automate on GitHub happens in the context of a CI pipeline like in GitHub Actions. There are many cases for small scripts where you just need to execute a couple of commands.
Yeah, and this is the correct way to automate anything relating to github. Their API is insane.
...unless you use their CLI wrapper over the API (as in this post) :)