Files
calculate-version/action.yml
T
jiantw83 fa4f7cd50b
CI / 1. BUILD (pull_request) Successful in 1s
CI / 2. TEST (pull_request) Successful in 3s
CI / 3. RESULT (pull_request) Successful in 2s
docs(calculate-version): 重整 action 與 workflow 文件
2026-07-11 13:15:21 +00:00

55 lines
2.0 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# --------------------------------------------------
# 用途:宣告 Calculate Version action 的輸入、輸出與 Docker 執行方式。
# 更新日期:2026/07/11 21:08:44Asia/Taipei
# --------------------------------------------------
# action 的顯示名稱。
name: "Calculate Version"
# action 的簡短描述。
description: "計算版本號"
# action 的作者資訊。
author: "Jeffery"
# 宣告可由呼叫端傳入的輸入參數。
inputs:
# 是否以 beta 模式計算版本,預設關閉。
is_beta:
# 參數說明文字。
description: "是否為 beta 版本"
# 未提供時預設為 false,讓一般流程走正式版邏輯。
default: "false"
# 用於讀取 release 資訊的 token,保留為可選輸入。
runner_token:
# 參數說明文字。
description: "用於讀取 release 的 token"
# 明確標示不是必填,呼叫端可依環境提供。
required: false
# 宣告 action 會輸出的結果欄位。
outputs:
# 將計算後的版本號輸出給後續工作流程使用。
version:
# 輸出說明文字。
description: "計算出的版本號"
# 指定此 action 以 Docker 模式執行。
runs:
# 透過 Docker image 啟動。
using: "docker"
# 使用同目錄下的 Dockerfile 建置映像。
image: "Dockerfile"
# 將 Gitea 與呼叫端輸入注入容器環境,供 entrypoint 與 Node 程式讀取。
env:
# Gitea 伺服器 URL,供程式組出 API 或資源路徑。
GITEA_SERVER_URL: ${{ gitea.server_url }}
# 目前倉庫識別資訊。
GITEA_REPOSITORY: ${{ gitea.repository }}
# Gitea token,供程式讀取受保護資源。
GITEA_TOKEN: ${{ gitea.token }}
# runner_token 的優先來源是輸入值,其次是 secrets.GITEA_TOKEN,再其次是 secrets.RUNNER_TOKEN。
RUNNER_TOKEN: ${{ inputs.runner_token || secrets.GITEA_TOKEN || secrets.RUNNER_TOKEN }}
# 將呼叫端的 beta 設定直接傳入容器。
IS_BETA: ${{ inputs.is_beta }}