feat: add get_repo_list() and replace REPO_N_NAME with REPO_NAMES in validation
- Add get_repo_list() helper to split space-delimited REPO_NAMES - Replace REPO_1_NAME/REPO_2_NAME/REPO_3_NAME with single REPO_NAMES in _ENV_VAR_NAMES and _ENV_VAR_TYPES validation arrays Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -123,6 +123,15 @@ require_vars() {
|
||||
done
|
||||
}
|
||||
|
||||
# Split REPO_NAMES (space-delimited) into one name per line.
|
||||
# Usage: while IFS= read -r repo; do ...; done < <(get_repo_list)
|
||||
# or: read -ra REPOS <<< "$REPO_NAMES" (for array-style usage)
|
||||
get_repo_list() {
|
||||
local repos=()
|
||||
read -ra repos <<< "${REPO_NAMES:-}"
|
||||
printf '%s\n' "${repos[@]}"
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# .env value validators — shared by configure_env.sh, preflight.sh,
|
||||
# bitwarden_to_env.sh. Each returns 0 (valid) or 1 (invalid).
|
||||
@@ -202,7 +211,7 @@ _ENV_VAR_NAMES=(
|
||||
BACKUP_STORAGE_PATH BACKUP_RETENTION_COUNT
|
||||
RUNNER_DEFAULT_IMAGE RUNNER_DEFAULT_CAPACITY RUNNER_DEFAULT_DATA_PATH LOCAL_RUNNER_DATA_PATH
|
||||
GITHUB_USERNAME GITHUB_TOKEN
|
||||
REPO_1_NAME REPO_2_NAME REPO_3_NAME
|
||||
REPO_NAMES
|
||||
MIGRATE_ISSUES MIGRATE_LABELS MIGRATE_MILESTONES MIGRATE_WIKI
|
||||
GITHUB_MIRROR_INTERVAL
|
||||
NGINX_CONTAINER_NAME NGINX_CONF_PATH SSL_MODE
|
||||
@@ -222,7 +231,7 @@ _ENV_VAR_TYPES=(
|
||||
path integer
|
||||
nonempty positive_integer nonempty nonempty
|
||||
nonempty nonempty
|
||||
nonempty nonempty nonempty
|
||||
nonempty
|
||||
bool bool bool bool
|
||||
nonempty
|
||||
nonempty path ssl_mode
|
||||
|
||||
Reference in New Issue
Block a user