Can we use the github app or oauth app instead of github PAT to generate the RUNNER_TOKEN?

Can we use the github app or oauth app instead of github PAT to generate the RUNNER_TOKEN? The problem with PAT is that none of our Github organization admins want to give the PAT.

I am trying to register the self-hosted runner (Docker container) at the organization level using this API. (I am following this article except for the k8s part.). If I use the personal access token of the Github organization admin, it works. But we don’t want to use it from the docker runner since it’s the “personal” access token.

I have looked at Oauth App device flow but it needs some manual things like entering the code and etc.

Here is an overview of the entire process for creating a self-hosted registration token using an App:

Thanks, @github-support.
I created the Github app in my organization. So I can get the app id.

Do you have a bash script instead of Ruby to genereate the JWT?

I tried to use this one https://gist.github.com/michaelsync/4ad968e96631dbb9638e57de29b6b937 but didn’t work. I am getting this error. My bash works fine with PAT (both repo level or org level).

{"message":"Not Found","documentation_url":"https://docs.github.com/rest"}
Response status code does not indicate success: 404 (Not Found).

No worries. I found a way to do it. Thanks.

1 Like