Files
cleanup-release/entrypoint.sh

22 lines
602 B
Bash

#!/bin/bash
set -euo pipefail
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"
if [[ -n "$PACKAGE_NAME" ]]; then
/cleanup-images.sh "$GITEA_SERVER" "$REPOSITORY" "$PACKAGE_NAME" "$TOKEN" "$KEEP_COUNT" "$DRY_RUN"
fi