Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ed12823df3 | |||
| 6197bbe690 | |||
| 4a748313d2 | |||
| caca2c9a91 |
@@ -1,10 +1,11 @@
|
||||
name: CD
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
jobs:
|
||||
version:
|
||||
name: "CD > 計算版本號"
|
||||
name: 計算版本號
|
||||
runs-on: ubuntu
|
||||
outputs:
|
||||
version: ${{ steps.version.outputs.version }}
|
||||
@@ -13,7 +14,7 @@ jobs:
|
||||
id: version
|
||||
uses: https://gitea.jsc.idv.tw/actions/calculate-version@${{ vars.ACTION_CALCULATE_VERSION }}
|
||||
release:
|
||||
name: "CD > 發布專案"
|
||||
name: 發布專案
|
||||
runs-on: ubuntu
|
||||
needs: version
|
||||
steps:
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
name: AI
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, synchronize]
|
||||
jobs:
|
||||
code-review:
|
||||
name: Code Review
|
||||
runs-on: ubuntu
|
||||
steps:
|
||||
- name: AI Code Review
|
||||
uses: https://gitea.jsc.idv.tw/actions/code-review@${{ vars.ACTION_CODE_REVIEW_VERSION }}
|
||||
with:
|
||||
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }},${{ secrets.GEMINI_API_KEY_1 }},${{ secrets.GEMINI_API_KEY_2 }},${{ secrets.GEMINI_API_KEY_3 }},${{ secrets.GEMINI_API_KEY_4 }},${{ secrets.GEMINI_API_KEY_5 }},${{ secrets.GEMINI_API_KEY_6 }},${{ secrets.GEMINI_API_KEY_7 }},${{ secrets.GEMINI_API_KEY_8 }},${{ secrets.GEMINI_API_KEY_9 }},${{ secrets.GEMINI_API_KEY_10 }},${{ secrets.GEMINI_API_KEY_11 }},${{ secrets.GEMINI_API_KEY_12 }},${{ secrets.GEMINI_API_KEY_13 }},${{ secrets.GEMINI_API_KEY_14 }},${{ secrets.GEMINI_API_KEY_15 }},${{ secrets.GEMINI_API_KEY_16 }},${{ secrets.GEMINI_API_KEY_17 }},${{ secrets.GEMINI_API_KEY_18 }},${{ secrets.GEMINI_API_KEY_19 }}
|
||||
GEMINI_BASE_URL: https://generativelanguage.googleapis.com/v1beta
|
||||
GEMINI_MODEL: ${{ vars.GEMINI_MODEL }}
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
issues: write
|
||||
+10
-4
@@ -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 "參數檢查"
|
||||
@@ -25,15 +34,12 @@ while true; do
|
||||
# 使用 curl 取得狀態碼,最長等待 60 秒,並將結果輸出到環境變數 STATUS_CODE
|
||||
STATUS_CODE=$(curl -s --max-time 60 -o /dev/null -w "%{http_code}" "$CHECK_URL")
|
||||
|
||||
echo "$STATUS_CODE" && [ "$STATUS_CODE" != "000" ] && break
|
||||
echo "$STATUS_CODE" && [ "$STATUS_CODE" == "$HEALTH_CODE" ] && break
|
||||
|
||||
# 如果狀態碼為 "000",表示連線失敗,等待 60 秒後重試
|
||||
sleep 60
|
||||
done
|
||||
|
||||
# 檢查狀態碼是否正確
|
||||
[ "$STATUS_CODE" = "$HEALTH_CODE" ] && exit 0 || exit 1
|
||||
|
||||
echo "=================================================="
|
||||
|
||||
# 將狀態碼輸出到環境變數
|
||||
|
||||
Reference in New Issue
Block a user