fix: add validation for comma-separated repos in registration token resolution
This commit is contained in:
@@ -217,9 +217,17 @@ build_runner_labels() {
|
|||||||
# Resolve registration token based on repos field.
|
# Resolve registration token based on repos field.
|
||||||
# repos=all → instance-level token from .env
|
# repos=all → instance-level token from .env
|
||||||
# repos=<name> → fetch repo-level token from Gitea API
|
# repos=<name> → fetch repo-level token from Gitea API
|
||||||
|
# Comma-separated repos are NOT supported here — configure_runners.sh
|
||||||
|
# expands them into separate INI sections before they reach this point.
|
||||||
# Sets RUNNER_REG_TOKEN.
|
# Sets RUNNER_REG_TOKEN.
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
resolve_registration_token() {
|
resolve_registration_token() {
|
||||||
|
if [[ "$RUNNER_REPOS" == *,* ]]; then
|
||||||
|
log_error "Runner '$RUNNER_NAME': repos='$RUNNER_REPOS' contains commas."
|
||||||
|
log_error " Each act_runner process can only register to one repo."
|
||||||
|
log_error " Run ./setup/configure_runners.sh to expand into separate runner sections."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
if [[ "$RUNNER_REPOS" == "all" ]] || [[ -z "$RUNNER_REPOS" ]]; then
|
if [[ "$RUNNER_REPOS" == "all" ]] || [[ -z "$RUNNER_REPOS" ]]; then
|
||||||
RUNNER_REG_TOKEN="${GITEA_RUNNER_REGISTRATION_TOKEN:-}"
|
RUNNER_REG_TOKEN="${GITEA_RUNNER_REGISTRATION_TOKEN:-}"
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user