Merge pull request '調整:第三方 action 與工具的版本也從 Gitea 變數取得' (#2) from chore/third-party-versions into main
ci / test (push) Successful in 4s

Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
2026-11-05 04:51:09 +00:00
3 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ jobs:
test:
runs-on: docker-ubuntu
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@${{ vars.ACTION_CHECKOUT_VERSION }}
- uses: ./
with:
checkout: false
+1 -1
View File
@@ -25,7 +25,7 @@ steps:
不要對 Docker action 用 `uses: ./` 自測:這台 runner 會依名稱重用舊映像檔,可能跑到別的專案的映像檔。
內部用的 `shellcheck`、`ci-env` 版本取自呼叫端 repo 的 Gitea 變數 `ACTION_SHELLCHECK_VERSION`、`ACTION_CI_ENV_VERSION`(不寫死在 `action.yml`),所以呼叫端要先設好這兩個變數。
內部用的版本都取自呼叫端 repo 的 Gitea 變數(不寫死在 `action.yml`),所以呼叫端要先設好:`ACTION_CHECKOUT_VERSION`、`ACTION_SHELLCHECK_VERSION`、`ACTION_CI_ENV_VERSION`,以及 shellcheck 工具本身的 `TOOL_SHELLCHECK_VERSION`(例如 `v0.10.0`)。
## 開發與發版
+3 -2
View File
@@ -1,5 +1,5 @@
name: action-ci
description: "action repo 的共用 CI:checkout → shellcheck → Go 腳本測試(有 go.mod 與 test/ 才跑,在 ci-env 容器裡,Go 版本取 go.mod)→ 建置映像檔(有 Dockerfile 才跑,可選擇實際執行並檢查輸出)。自動偵測,各 repo 的 ci.yaml 不必設開關。內部用的 shellcheck、ci-env 版本取自呼叫端的 Gitea 變數 ACTION_SHELLCHECK_VERSION、ACTION_CI_ENV_VERSION"
description: "action repo 的共用 CI:checkout → shellcheck → Go 腳本測試(有 go.mod 與 test/ 才跑,在 ci-env 容器裡,Go 版本取 go.mod)→ 建置映像檔(有 Dockerfile 才跑,可選擇實際執行並檢查輸出)。自動偵測,各 repo 的 ci.yaml 不必設開關。版本都取自呼叫端的 Gitea 變數:ACTION_CHECKOUT_VERSION、ACTION_SHELLCHECK_VERSION、ACTION_CI_ENV_VERSION、TOOL_SHELLCHECK_VERSION(shellcheck 本身)"
inputs:
checkout:
description: "true=先 checkout;false=呼叫端已經 checkout(例如要用 uses: ./ 測自己)"
@@ -24,7 +24,7 @@ runs:
steps:
- name: checkout
if: ${{ inputs.checkout == 'true' }}
uses: actions/checkout@v4
uses: actions/checkout@${{ vars.ACTION_CHECKOUT_VERSION }}
- name: 偵測
id: detect
shell: bash
@@ -35,6 +35,7 @@ runs:
uses: https://gitea.jsc.idv.tw/actions/shellcheck@${{ vars.ACTION_SHELLCHECK_VERSION }}
with:
files: ${{ inputs.shellcheck_files }}
version: ${{ vars.TOOL_SHELLCHECK_VERSION }}
- name: Go 測試
if: ${{ steps.detect.outputs.go == 'true' }}
uses: https://gitea.jsc.idv.tw/actions/ci-env@${{ vars.ACTION_CI_ENV_VERSION }}