Configuration tries to use the registration endpoint even when passed `--token <token>`
See original GitHub issueDescribe the bug
When running the configuration of the runner unattended, some means of authenticating is required. The documentation at https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization claims that a token from that endpoint can be used with the --token <token>
option. Instead, the runner attempts to obtain a new one with a PAT that may or may not be passed to it (See ConfigurationManager.cs#L111) In the case that it isn’t, the configuration fails with a 404.
To Reproduce Steps to reproduce the behavior:
- Obtain a registration token from
https://api.github.com/orgs/ORG/actions/runners/registration-token
, whereORG
is a valid organization. Call this registration tokenTOKEN
. - Run
./config --unattended --url https://github.com/ORG --token TOKEN
- An error is printed out and the runner exits
Expected behavior What is described to be possible in https://docs.github.com/en/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization
Runner Version and Platform
Version 2.291.1, Commit 496ec0df97891bd8e50f4431d01874ac3ab75a93
OS of the machine running the runner? OSX/Windows/Linux/… Linux, Ubuntu 20.04.4 LTS
What’s not working?
Http response code: NotFound from 'POST https://api.github.com/actions/runner-registration'
{"message":"Not Found","documentation_url":"https://docs.github.com/rest"}
Response status code does not indicate success: 404 (Not Found).
Job Log Output
N/A
Runner and Worker’s Diagnostic Logs
N/A
Issue Analytics
- State:
- Created a year ago
- Reactions:38
- Comments:35
Top GitHub Comments
I tried to reproduce the issue you reported, but I had no problem with org runner configuration. Are you sure that your token just didn’t expire, since the token generated this way expires after an hour?
+1. Seems like Github really wants you paying for their own runners.