Add fj runner token #289
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/runner-token"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
fj runner tokenprints an Actions runner registration token and nothing else, so provisioning can runforgejo-runner register --token "$(fj runner token --org rasterstate)"instead of a hand-rolled API call.Scope follows the rest of the CLI: the repository from
-Ror the current clone by default,--org <ORG>for an organization,--userfor your own account,--instancefor the whole forge (instance administrators only). The issue sketched a barefj runner tokenas the instance scope; that would have made the one command that ignores the clone it is run from, so the instance scope is an explicit flag. The scope flags conflict with each other and with-R.A 403 or 404 comes back through the usual error mapping (exit 4 and 3). An empty token in a 200 is an error instead of an empty line on stdout.
The token is printed without the terminal guard
fj auth tokenhas. It is a join credential, but the web UI shows it in the clear and the point of the command is to be pasted or piped, so a--forcestep seemed like friction with no gain. Easy to add if you would prefer the stricter default.Checked live against rasterhub.com for all four scopes (lengths only, tokens not logged).
scripts/e2e-smoke.shgains the repo-scope read underFJ_E2E_ADMIN=1; itsrunhelper discards stdout.The second commit is the same quinn-proto lockfile bump as #288, carried here so the audit gate passes on this branch too. Whichever merges second drops it on rebase.
The fjord-docs CLI reference needs regenerating once this lands, with
runneradded to the Actions section ofscripts/gen-cli-reference.py.Closes #193