chore(action 設定): 整理用途標頭與排版

This commit is contained in:
2026-07-11 10:00:30 +00:00
parent 88e3e3d184
commit 1ed40a6b04
4 changed files with 63 additions and 43 deletions
+6 -1
View File
@@ -1,3 +1,8 @@
# --------------------------------------------------
# 用途:定義 CI 工作流程,處理 pull request 的版本發佈與測試。
# 更新日期:2026/07/11 17:44:33Asia/Taipei
# --------------------------------------------------
name: CI name: CI
on: on:
pull_request: pull_request:
@@ -53,7 +58,7 @@ jobs:
result: result:
name: 3. RESULT name: 3. RESULT
runs-on: ubuntu runs-on: ubuntu
needs: [build,test] needs: [build, test]
if: ${{ needs.build.outputs.is_beta == 'false' }} if: ${{ needs.build.outputs.is_beta == 'false' }}
env: env:
VERSION: ${{ needs.test.outputs.version }} VERSION: ${{ needs.test.outputs.version }}
+5
View File
@@ -1,3 +1,8 @@
# --------------------------------------------------
# 用途:定義 calculate-version action 的 Docker 執行環境。
# 更新日期:2026/07/11 17:44:33Asia/Taipei
# --------------------------------------------------
FROM node:lts-alpine FROM node:lts-alpine
WORKDIR /action WORKDIR /action
+14 -9
View File
@@ -1,19 +1,24 @@
name: 'Calculate Version' # --------------------------------------------------
description: '計算版本號' # 用途:宣告 Calculate Version action 的輸入、輸出與 Docker 執行方式。
author: 'Jeffery' # 更新日期:2026/07/11 17:44:33Asia/Taipei
# --------------------------------------------------
name: "Calculate Version"
description: "計算版本號"
author: "Jeffery"
inputs: inputs:
is_beta: is_beta:
description: '是否為 beta 版本' description: "是否為 beta 版本"
default: 'false' default: "false"
runner_token: runner_token:
description: '用於讀取 release 的 token' description: "用於讀取 release 的 token"
required: false required: false
outputs: outputs:
version: version:
description: '計算出的版本號' description: "計算出的版本號"
runs: runs:
using: 'docker' using: "docker"
image: 'Dockerfile' image: "Dockerfile"
env: env:
GITEA_SERVER_URL: ${{ gitea.server_url }} GITEA_SERVER_URL: ${{ gitea.server_url }}
GITEA_REPOSITORY: ${{ gitea.repository }} GITEA_REPOSITORY: ${{ gitea.repository }}
+5
View File
@@ -1,4 +1,9 @@
#!/bin/sh #!/bin/sh
# --------------------------------------------------
# 用途:啟動 calculate-version action,將所有參數交給 Node 主程式。
# 更新日期:2026/07/11 17:44:33Asia/Taipei
# --------------------------------------------------
set -eu set -eu
exec node /action/src/index.js "$@" exec node /action/src/index.js "$@"