5 Commits
Author SHA1 Message Date
admin 81178aa5c1 Merge pull request '調整:ci 只在 PR 觸發(拿掉 push: main)' (#3) from chore/ci-pr-only into main
Reviewed-on: #3
2026-11-05 04:55:20 +00:00
bot c7878bb440 調整:ci 只在 PR 觸發(拿掉 push: main,和羽藏一致)
cd / tag (pull_request) Successful in 6s
ci / test (pull_request) Successful in 22s
2026-11-05 04:53:12 +00:00
admin 919817adec Merge pull request '調整:第三方 action 與工具的版本也從 Gitea 變數取得' (#2) from chore/third-party-versions into main
ci / test (push) Successful in 4s
Reviewed-on: #2
2026-11-05 04:51:09 +00:00
bot 2cac19095b 調整:第三方 action 與工具的版本也從 Gitea 變數取得
ci / test (pull_request) Successful in 4s
cd / tag (pull_request) Successful in 3s
2026-11-05 04:44:27 +00:00
admin 63ad33f2dc Merge pull request '調整:ci/cd 一致化,版本計算抽到 next-version' (#1) from chore/unify-ci-cd into main
ci / test (push) Successful in 3s
Reviewed-on: #1
2026-11-05 04:28:09 +00:00
3 changed files with 5 additions and 6 deletions
+1 -3
View File
@@ -1,7 +1,5 @@
name: ci
on:
push:
branches: [main]
pull_request:
concurrency:
group: ci-${{ github.ref }}
@@ -10,7 +8,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 }}