fix: update organization existence check to verify Gitea API settings endpoint
This commit is contained in:
@@ -55,15 +55,10 @@ run_check "API token valid (returns correct username)" check_token
|
|||||||
run_check "Organization '${GITEA_ORG_NAME}' exists" \
|
run_check "Organization '${GITEA_ORG_NAME}' exists" \
|
||||||
curl -sf -o /dev/null -H "Authorization: token ${GITEA_ADMIN_TOKEN}" "${GITEA_INTERNAL_URL}/api/v1/orgs/${GITEA_ORG_NAME}"
|
curl -sf -o /dev/null -H "Authorization: token ${GITEA_ADMIN_TOKEN}" "${GITEA_INTERNAL_URL}/api/v1/orgs/${GITEA_ORG_NAME}"
|
||||||
|
|
||||||
# Check 5: Gitea Actions admin runners API is accessible
|
# Check 5: Gitea API settings endpoint accessible
|
||||||
# shellcheck disable=SC2329
|
# Runners are verified in phase3_post_check.sh — phase 1 only deploys Gitea itself.
|
||||||
check_actions() {
|
run_check "Gitea API settings endpoint accessible" \
|
||||||
local response
|
curl -sf -o /dev/null -H "Authorization: token ${GITEA_ADMIN_TOKEN}" "${GITEA_INTERNAL_URL}/api/v1/settings/api"
|
||||||
response=$(curl -sf -H "Authorization: token ${GITEA_ADMIN_TOKEN}" "${GITEA_INTERNAL_URL}/api/v1/admin/runners")
|
|
||||||
# Endpoint should return a JSON array (possibly empty) when available.
|
|
||||||
printf '%s' "$response" | jq -e 'type == "array"' >/dev/null
|
|
||||||
}
|
|
||||||
run_check "Gitea Actions admin runners API accessible" check_actions
|
|
||||||
|
|
||||||
# Summary
|
# Summary
|
||||||
printf '\n'
|
printf '\n'
|
||||||
|
|||||||
Reference in New Issue
Block a user