新增:docker_build 用唯一標籤建置,可實際執行並檢查輸出
ci / test (push) Successful in 5s

This commit is contained in:
bot
2026-11-05 03:20:03 +00:00
parent 6a1819e2a1
commit c97f8b16aa
4 changed files with 45 additions and 5 deletions
+15 -2
View File
@@ -11,8 +11,17 @@ inputs:
description: "go_test 為 true 時執行的指令"
default: "go vet ./... && go test ./test/"
docker_build:
description: "true=用 docker build 檢查 Dockerfile 建得起來"
description: "true=用 docker build 檢查 Dockerfile 建得起來(映像檔標籤唯一,不會撞到 runner 上的舊映像檔)"
default: "false"
docker_run_args:
description: "docker_build 之後實際執行容器的參數(entrypoint 的參數,每行一個);空=不執行"
default: ""
docker_run_options:
description: "執行容器的 docker create 選項(每行一個,例如 --env=INPUT_TASK=resolve-channel)"
default: ""
docker_run_expect:
description: "容器輸出必須包含的字串;空=只檢查結束碼"
default: ""
runs:
using: composite
steps:
@@ -30,4 +39,8 @@ runs:
- name: 建置映像檔
if: ${{ inputs.docker_build == 'true' }}
shell: bash
run: docker build -t "action-test:$GITHUB_SHA" .
env:
RUN_ARGS: ${{ inputs.docker_run_args }}
RUN_OPTIONS: ${{ inputs.docker_run_options }}
RUN_EXPECT: ${{ inputs.docker_run_expect }}
run: bash "${{ github.action_path }}/docker-check.sh"