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"