diff --git a/notify-slack/action.yml b/notify-slack/action.yml index 9fb76f4..e59bac9 100644 --- a/notify-slack/action.yml +++ b/notify-slack/action.yml @@ -14,11 +14,20 @@ runs: ACTOR: ${{ gitea.actor }} RUN_NUMBER: ${{ gitea.run_number }} SHA: ${{ gitea.sha }} + COMMIT_MSG: ${{ gitea.event.head_commit.message }} run: | set -eu SHORT_SHA="${SHA:0:7}" STATUS_URL="https://status.gitea.pitap.at/${REPO}/actions/runs/${RUN_NUMBER}" - COMMIT_MSG="$(git log -1 --pretty=format:%s 2>/dev/null || echo '(no message)')" + + # 이벤트에서 못 받았으면 (수동 trigger 등) git에서 시도, 그것도 실패하면 fallback + if [ -z "${COMMIT_MSG:-}" ]; then + COMMIT_MSG="$(git log -1 --pretty=format:%s 2>/dev/null || echo '(no message)')" + fi + + # 멀티라인 커밋 메시지면 첫 줄만 + COMMIT_MSG="$(printf '%s' "$COMMIT_MSG" | head -n1)" + HEADER_TEXT="🚀 배포 시작 — ${REPO}" PAYLOAD=$(jq -n \