fix: add validation for comma-separated repos in registration token resolution

This commit is contained in:
S
2026-03-02 09:15:47 -05:00
parent b22a95522b
commit 7bf3a1bfd5

View File

@@ -217,9 +217,17 @@ build_runner_labels() {
# Resolve registration token based on repos field.
# repos=all → instance-level token from .env
# 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.
# ---------------------------------------------------------------------------
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
RUNNER_REG_TOKEN="${GITEA_RUNNER_REGISTRATION_TOKEN:-}"
else