From d307361810498f2192bb09ce324a216d473f88d8 Mon Sep 17 00:00:00 2001 From: S Date: Mon, 2 Mar 2026 09:29:28 -0500 Subject: [PATCH] fix: update organization existence check and enhance Gitea Actions API accessibility verification --- phase1_post_check.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/phase1_post_check.sh b/phase1_post_check.sh index 0f0cf5b..94440bd 100755 --- a/phase1_post_check.sh +++ b/phase1_post_check.sh @@ -55,15 +55,15 @@ run_check "API token valid (returns correct username)" check_token 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}" -# Check 5: Gitea Actions enabled (verify via settings API) +# Check 5: Gitea Actions admin runners API is accessible # shellcheck disable=SC2329 check_actions() { - # The /api/v1/settings/api endpoint returns instance settings. - # If Actions are enabled, the Gitea instance will accept runner registrations. - # We can also check by simply verifying the admin/runners endpoint responds. - curl -sf -H "Authorization: token ${GITEA_ADMIN_TOKEN}" "${GITEA_INTERNAL_URL}/api/v1/settings/api" -o /dev/null + local response + 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 API settings accessible (Actions check)" check_actions +run_check "Gitea Actions admin runners API accessible" check_actions # Summary printf '\n'