From 4a748313d2737112067be513496472f4fdc3ec46 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Fri, 27 Mar 2026 14:56:28 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=80=8F=E9=81=8E=20trap=20=E5=9C=A8?= =?UTF-8?q?=E6=94=B6=E5=88=B0=E8=A8=8A=E8=99=9F=E6=99=82=E7=AB=8B=E5=8D=B3?= =?UTF-8?q?=E9=80=80=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entrypoint.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/entrypoint.sh b/entrypoint.sh index 68f3be1..9e719ab 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,5 +1,14 @@ #!/bin/bash +# 當 GitHub Actions 手動取消 workflow 時,Runner 會對容器送出終止訊號。 +# 透過 trap 可在收到訊號時立即退出,避免無限迴圈持續重試。 +on_terminate() { + echo "[$(date -u +"%Y-%m-%dT%H:%M:%SZ")] 收到取消訊號,停止健康檢查。" + exit 130 +} + +trap on_terminate TERM INT + echo "==================================================" echo "參數檢查"