fix(calculate-version): 統一輸出與錯誤格式

This commit is contained in:
2026-07-11 10:00:27 +00:00
parent 5883abd306
commit 88e3e3d184
2 changed files with 153 additions and 11 deletions
+17 -10
View File
@@ -1,8 +1,13 @@
# --------------------------------------------------
# 用途:定義 CD 工作流程,於 master push 後部署並顯示相關 tag。
# 更新日期:2026/07/11 17:44:33Asia/Taipei
# --------------------------------------------------
name: CD
on:
push:
branches:
- master
- master
jobs:
deploy:
name: DEPLOY
@@ -10,12 +15,14 @@ jobs:
env:
COMMIT_SHA: ${{ gitea.event.commits[1].id }}
steps:
- name: Source Code Checkout
uses: actions/checkout@${{ vars.ACTION_CHECKOUT_VERSION }}
with:
fetch-depth: 0
- name: Get Commit Tag
id: commit
run: echo "tag=$(git for-each-ref --sort=-refname --format='%(refname:strip=2)' refs/tags --contains ${{ env.COMMIT_SHA }} | head -n 1)" >> $GITEA_OUTPUT
- name: Show Tag
run: echo "${{ steps.commit.outputs.tag }}"
- name: Source Code Checkout
uses: actions/checkout@${{ vars.ACTION_CHECKOUT_VERSION }}
with:
fetch-depth: 0
- name: Get Commit Tag
id: commit
run: >-
echo "tag=$(git for-each-ref --sort=-refname --format='%(refname:strip=2)' refs/tags --contains ${{ env.COMMIT_SHA }} | head -n 1)" >> $GITEA_OUTPUT
- name: Show Tag
run: >-
echo "[DEPLOY][INF][$(TZ='Asia/Taipei' date +'%Y/%m/%d %H:%M:%S')]: ${{ steps.commit.outputs.tag }}"