test: 嘗試修正 INPUT_GITEA_SERVER: unbound variable 問題

This commit is contained in:
Jeffery
2026-03-20 14:25:53 +08:00
parent ea8b72ce8f
commit cd5480b334
2 changed files with 18 additions and 6 deletions

View File

@@ -25,3 +25,10 @@ inputs:
runs: runs:
using: 'docker' using: 'docker'
image: 'Dockerfile' 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 }}

View File

@@ -2,12 +2,17 @@
set -euo pipefail set -euo pipefail
GITEA_SERVER="${INPUT_GITEA_SERVER}" GITEA_SERVER="${GITEA_SERVER:-}"
REPOSITORY="${INPUT_REPOSITORY}" REPOSITORY="${REPOSITORY:-}"
PACKAGE_NAME="${INPUT_PACKAGE_NAME:-}" PACKAGE_NAME="${PACKAGE_NAME:-}"
TOKEN="${INPUT_TOKEN}" TOKEN="${TOKEN:-}"
KEEP_COUNT="${INPUT_KEEP_COUNT:-2}" KEEP_COUNT="${KEEP_COUNT:-2}"
DRY_RUN="${INPUT_DRY_RUN:-false}" 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" /cleanup-releases.sh "$GITEA_SERVER" "$REPOSITORY" "$TOKEN" "$KEEP_COUNT" "$DRY_RUN"