Skip to content

Programmatically registering self-hosted Runners #27204

Answered by jmaukisch
jmaukisch asked this question in Actions
Discussion options

You must be logged in to vote

What I did so far is:

  • Created an app with the " Repository permissions" “Administration: Read & Write”
  • Generate and Download the Private Key
  • Install the App on a Repository
  • Used the Ruby Script form the Documentation to generate a JWT for the App
  • Used the generated JWT to call the API to get an Application Access Token:
curl -i -X POST \
-H "Authorization: Bearer <JWT>" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/app/installations/<Installation Id of your App for the Repo>/access_tokens \
 -d '{"repositories":["name-of-your-repo"]}'
  • Use the token in the response to call the endpoint to get the registration token for the runner for the repo
curl \
  -X POST …

Replies: 6 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants