문법 오류 수정. 레포 이름 개선

This commit is contained in:
Lectom C Han
2025-12-16 09:39:40 +09:00
parent 9aad965a91
commit f6246bc878

View File

@@ -45,7 +45,7 @@ jobs:
notify_status() { notify_status() {
local status="$1" repo="$2" branch="$3" mode="$4" start_epoch="$5" extra="${6:-}" local status="$1" repo="$2" branch="$3" mode="$4" start_epoch="$5" extra="${6:-}"
local ts end_epoch duration text local ts end_epoch duration text payload
[[ -z "${NOTIFY_WEBHOOK}" ]] && return [[ -z "${NOTIFY_WEBHOOK}" ]] && return
ts=$(TZ=Asia/Seoul date '+%Y-%m-%d %H:%M:%S %Z') ts=$(TZ=Asia/Seoul date '+%Y-%m-%d %H:%M:%S %Z')
case "${status}" in case "${status}" in
@@ -66,16 +66,11 @@ jobs:
text="센터Git ${repo} 상태: ${status} (${ts})" text="센터Git ${repo} 상태: ${status} (${ts})"
;; ;;
esac esac
cat <<EOF | curl -sS -i -X POST \ payload=${text//\"/\\\"}
curl -sS -i -X POST \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-d @- \ -d "{\"username\":\"Gitea\",\"icon_url\":\"https://gitea.hmac.kr/assets/img/logo.svg\",\"text\":\"${payload}\"}" \
"${NOTIFY_WEBHOOK}" >/dev/null || echo "::warning::Notification failed for ${repo} (${status})" "${NOTIFY_WEBHOOK}" >/dev/null || echo "::warning::Notification failed for ${repo} (${status})"
{
"username": "Gitea",
"icon_url": "https://gitea.hmac.kr/assets/img/logo.svg",
"text": "${text}"
}
EOF
} }
set_default_branch_main() { set_default_branch_main() {
@@ -128,6 +123,10 @@ EOF
repo_name="base" repo_name="base"
elif [[ "${branch_name}" == "Develop_Net8_"* ]]; then elif [[ "${branch_name}" == "Develop_Net8_"* ]]; then
repo_name="${branch_name#Develop_Net8_}" repo_name="${branch_name#Develop_Net8_}"
elif [[ "${branch_name}" == "Develop_"* ]]; then
repo_name="${branch_name#Develop_}"
elif [[ "${branch_name}" == "develop_"* ]]; then
repo_name="${branch_name#develop_}"
fi fi
echo "Target repository name: ${repo_name}" echo "Target repository name: ${repo_name}"