From cd5480b3349402b9a2fa1115515f2e5556c04828 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Fri, 20 Mar 2026 14:25:53 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E5=98=97=E8=A9=A6=E4=BF=AE=E6=AD=A3=20?= =?UTF-8?q?INPUT=5FGITEA=5FSERVER:=20unbound=20variable=20=E5=95=8F?= =?UTF-8?q?=E9=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- action.yml | 7 +++++++ entrypoint.sh | 17 +++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/action.yml b/action.yml index 9aa3f1b..0b2a2ef 100644 --- a/action.yml +++ b/action.yml @@ -25,3 +25,10 @@ inputs: runs: using: 'docker' image: 'Dockerfile' + env: + GITEA_SERVER: ${{ inputs.gitea-server }} + REPOSITORY: ${{ inputs.repository }} + PACKAGE_NAME: ${{ inputs.package-name }} + TOKEN: ${{ inputs.token }} + KEEP_COUNT: ${{ inputs.keep-count }} + DRY_RUN: ${{ inputs.dry-run }} diff --git a/entrypoint.sh b/entrypoint.sh index c781874..120ee26 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,12 +2,17 @@ set -euo pipefail -GITEA_SERVER="${INPUT_GITEA_SERVER}" -REPOSITORY="${INPUT_REPOSITORY}" -PACKAGE_NAME="${INPUT_PACKAGE_NAME:-}" -TOKEN="${INPUT_TOKEN}" -KEEP_COUNT="${INPUT_KEEP_COUNT:-2}" -DRY_RUN="${INPUT_DRY_RUN:-false}" +GITEA_SERVER="${GITEA_SERVER:-}" +REPOSITORY="${REPOSITORY:-}" +PACKAGE_NAME="${PACKAGE_NAME:-}" +TOKEN="${TOKEN:-}" +KEEP_COUNT="${KEEP_COUNT:-2}" +DRY_RUN="${DRY_RUN:-false}" + +if [[ -z "$GITEA_SERVER" ]] || [[ -z "$REPOSITORY" ]] || [[ -z "$TOKEN" ]]; then + echo "❌ 錯誤:缺少必要的 inputs (gitea-server, repository, token)" + exit 1 +fi /cleanup-releases.sh "$GITEA_SERVER" "$REPOSITORY" "$TOKEN" "$KEEP_COUNT" "$DRY_RUN" -- 2.48.1