크론잡 중단

This commit is contained in:
Lectom C Han
2025-12-24 10:20:49 +09:00
parent 99b701b988
commit 3e80848e81
3 changed files with 31 additions and 4 deletions

View File

@@ -7,8 +7,8 @@ on:
description: 'Comma-separated list of sourceRepo/branch entries to mirror (e.g., dev_Net8.git/Develop_Net8,dev.git/develop). If empty, all entries from branch_list file will be mirrored.'
required: false
default: ''
schedule:
- cron: '0 17 * * 1-5' # UTC 17:00 == KST 02:00, Mon-Fri only
# schedule:
# - cron: '0 17 * * 1-5' # UTC 17:00 == KST 02:00, Mon-Fri only
jobs:
backup:

View File

@@ -55,6 +55,19 @@ jobs:
TOTAL_SUCCESS=0
TOTAL_SKIP=0
TOTAL_ERROR=0
declare -a ERROR_BRANCHES=()
record_error_branch() {
local repo="$1" branch="$2" reason="$3"
local label="${branch}"
if [[ -n "${repo}" ]]; then
label="${branch} (${repo})"
fi
if [[ -n "${reason}" ]]; then
label="${label}: ${reason}"
fi
ERROR_BRANCHES+=("${label}")
}
notify_status() {
local status="$1" repo="$2" branch="$3" mode="$4" start_epoch="$5" extra="${6:-}"
@@ -62,7 +75,10 @@ jobs:
case "${status}" in
success) ((++TOTAL_SUCCESS)) ;;
skip) ((++TOTAL_SKIP)) ;;
error) ((++TOTAL_ERROR)) ;;
error)
((++TOTAL_ERROR))
record_error_branch "${repo}" "${branch}" "${extra}"
;;
esac
[[ -z "${NOTIFY_WEBHOOK}" ]] && return
ts=$(TZ=Asia/Seoul date '+%Y-%m-%d %H:%M:%S %Z')
@@ -390,8 +406,15 @@ jobs:
fi
TOTAL_PROCESSED=$((TOTAL_SUCCESS + TOTAL_SKIP + TOTAL_ERROR))
ERROR_LIST_TEXT=""
if (( TOTAL_ERROR > 0 )); then
ERROR_LIST_TEXT=$(printf '%s\n' "${ERROR_BRANCHES[@]}" | sort -u | paste -sd',' - | sed 's/,/, /g')
fi
SUMMARY_TS=$(TZ=Asia/Seoul date '+%Y-%m-%d %H:%M:%S %Z')
SUMMARY_TEXT="브랜치 동기화 완료: 총 ${TOTAL_PROCESSED}개 (성공 ${TOTAL_SUCCESS}, 동일로 건너뜀 ${TOTAL_SKIP}, 오류 ${TOTAL_ERROR}) - ${SUMMARY_TS}"
if (( TOTAL_ERROR > 0 )) && [[ -n "${ERROR_LIST_TEXT}" ]]; then
SUMMARY_TEXT="${SUMMARY_TEXT} | 오류 브랜치: ${ERROR_LIST_TEXT}"
fi
echo "${SUMMARY_TEXT}"
if [[ -n "${NOTIFY_WEBHOOK}" ]]; then
SUMMARY_PAYLOAD=${SUMMARY_TEXT//\"/\\\"}
@@ -402,6 +425,8 @@ jobs:
fi
if (( TOTAL_ERROR > 0 )); then
echo "::warning::One or more branches failed (${TOTAL_ERROR})."
ERROR_LIST_NOTICE="${ERROR_LIST_TEXT:-미기록}"
echo "::warning::Branches failed (${TOTAL_ERROR}): ${ERROR_LIST_NOTICE}"
echo "::notice::오류 브랜치 목록: ${ERROR_LIST_NOTICE}"
exit 1
fi