style(.gitea workflows): 對齊 CI/CD YAML 縮排
This commit is contained in:
@@ -29,20 +29,20 @@ jobs:
|
||||
COMMIT_SHA: ${{ gitea.event.commits[1].id }}
|
||||
# 定義 deploy job 的步驟。
|
||||
steps:
|
||||
# 先檢出完整原始碼與 tag 歷史,讓後續可以查詢 tag。
|
||||
- name: Source Code Checkout
|
||||
# 使用 checkout action,版本由倉庫變數控制。
|
||||
uses: actions/checkout@${{ vars.ACTION_CHECKOUT_VERSION }}
|
||||
with:
|
||||
# 取得完整歷史,避免 tag 查詢因淺層 clone 而失敗。
|
||||
fetch-depth: 0
|
||||
# 根據 COMMIT_SHA 找出包含該提交的最新 tag。
|
||||
- name: Get Commit Tag
|
||||
# 將查到的 tag 寫入 Gitea output。
|
||||
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
|
||||
# 將查到的 tag 輸出到日誌,方便人工確認。
|
||||
- name: Show Tag
|
||||
run: >-
|
||||
echo "[DEPLOY][INF][$(TZ='Asia/Taipei' date +'%Y/%m/%d %H:%M:%S')]: ${{ steps.commit.outputs.tag }}"
|
||||
# 先檢出完整原始碼與 tag 歷史,讓後續可以查詢 tag。
|
||||
- name: Source Code Checkout
|
||||
# 使用 checkout action,版本由倉庫變數控制。
|
||||
uses: actions/checkout@${{ vars.ACTION_CHECKOUT_VERSION }}
|
||||
with:
|
||||
# 取得完整歷史,避免 tag 查詢因淺層 clone 而失敗。
|
||||
fetch-depth: 0
|
||||
# 根據 COMMIT_SHA 找出包含該提交的最新 tag。
|
||||
- name: Get Commit Tag
|
||||
# 將查到的 tag 寫入 Gitea output。
|
||||
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
|
||||
# 將查到的 tag 輸出到日誌,方便人工確認。
|
||||
- name: Show Tag
|
||||
run: >-
|
||||
echo "[DEPLOY][INF][$(TZ='Asia/Taipei' date +'%Y/%m/%d %H:%M:%S')]: ${{ steps.commit.outputs.tag }}"
|
||||
|
||||
Reference in New Issue
Block a user