Files
calculate-version/entrypoint.sh
T
JefferyandClaude Opus 4.8 bd6b6017ab refactor(calculate-version): 將版本計算邏輯由 bash 改寫為 Node.js 並依功能分檔
保留 entrypoint.sh 作為容器進入點,改為啟動 app/ 下的 Node.js 程式;
依功能拆分為 logger/config/version/releases/output/index,並更新 Dockerfile 改用 node:lts-alpine。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26 10:41:34 +08:00

17 lines
892 B
Bash

#!/bin/bash
# =============================================================================
# 用途: calculate-version Action 的容器進入點 (entrypoint)。
# 專案已由 bash 改寫為 Node.js,本腳本僅負責啟動 /app/index.js,
# 並將容器收到的引數原封傳遞給 Node.js 程式執行版本計算邏輯。
# 更新日期: 2026/06/26 10:28:36
# =============================================================================
# set -e: 任一指令失敗即中止; set -u: 使用未定義變數即報錯;
# set -o pipefail: 管線中任一指令失敗即視為整體失敗。確保錯誤能即時暴露。
set -euo pipefail
# 進入點:實際邏輯改以 Node.js 實作,置於 /app
# 以 exec 取代當前 shell,讓 node 成為 PID 1 正確接收訊號;
# "$@" 將容器接收到的所有引數原樣轉交給 Node.js 程式。
exec node /app/index.js "$@"