chore: fix shellcheck findings across migration scripts
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
# shellcheck disable=SC2329
|
||||
|
||||
# =============================================================================
|
||||
# phase7_post_check.sh — Verify Phase 7 (Branch Protection) succeeded
|
||||
@@ -37,12 +38,14 @@ for repo in "${REPOS[@]}"; do
|
||||
log_info "--- Checking repo: ${repo} ---"
|
||||
|
||||
# Check 1: Protection rule exists
|
||||
# shellcheck disable=SC2329
|
||||
check_protection_exists() {
|
||||
gitea_api GET "/repos/${GITEA_ORG_NAME}/$1/branch_protections/${PROTECTED_BRANCH}" >/dev/null
|
||||
}
|
||||
run_check "Branch protection exists for '${PROTECTED_BRANCH}' on ${repo}" check_protection_exists "$repo"
|
||||
|
||||
# Check 2: Push is blocked (enable_push should be false)
|
||||
# shellcheck disable=SC2329
|
||||
check_push_blocked() {
|
||||
local protection
|
||||
protection=$(gitea_api GET "/repos/${GITEA_ORG_NAME}/${repo}/branch_protections/${PROTECTED_BRANCH}")
|
||||
|
||||
Reference in New Issue
Block a user