From d3cd0a8cc2e2b78b852d278c3737d21ca3694a5c Mon Sep 17 00:00:00 2001 From: Lectom C Han Date: Mon, 15 Dec 2025 18:08:24 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9D=91=EB=8B=B5=EC=BD=94=EB=93=9C=20?= =?UTF-8?q?=EB=8C=80=EC=9D=91=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/mirror.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/mirror.yml b/.gitea/workflows/mirror.yml index 7eca5b8..afb7c47 100644 --- a/.gitea/workflows/mirror.yml +++ b/.gitea/workflows/mirror.yml @@ -84,14 +84,17 @@ jobs: if [ "${http_status}" == "404" ]; then echo "Repository 'center_dev/${repo_name}' does not exist. Creating it..." - create_repo_response=$(curl -s -w "%{http_code}" -X POST -H "Content-Type: application/json" -H "${AUTH_HEADER}" -d "{\"name\":\"${repo_name}\",\"private\":true,\"default_branch\":\"main\"}" "${BASE_GITEA_URL}/api/v1/orgs/${CENTER_ORG}/repos") - create_status=$(echo "${create_repo_response}" | tail -c 3) - if [[ "${create_status}" -ne "201" ]]; then - echo "::error::Failed to create repository. API response:" - echo "${create_repo_response}" | head -c -3 + create_tmp="$(mktemp)" + create_status=$(curl -s -o "${create_tmp}" -w "%{http_code}" -X POST -H "Content-Type: application/json" -H "${AUTH_HEADER}" -d "{\"name\":\"${repo_name}\",\"private\":true,\"default_branch\":\"main\"}" "${BASE_GITEA_URL}/api/v1/orgs/${CENTER_ORG}/repos") + if [[ "${create_status}" != "201" ]]; then + echo "::error::Failed to create repository. HTTP ${create_status}" + cat "${create_tmp}" + rm -f "${create_tmp}" exit 1 fi echo "Repository created successfully." + repo_exists=true + rm -f "${create_tmp}" elif [ "${http_status}" != "200" ]; then echo "::error::Error checking repository. HTTP status: ${http_status}" exit 1