refactor: rename keep versions input

This commit is contained in:
2026-05-15 02:20:02 +00:00
parent c923a6ce55
commit 6d1ff786eb
4 changed files with 13 additions and 13 deletions
+6 -6
View File
@@ -90,17 +90,17 @@ run_entrypoint() {
write_mock_curl
output="$(run_entrypoint INPUT_RUNNER_TOKEN=abc INPUT_KEEP_VERSIONS=1)"
output="$(run_entrypoint INPUT_RUNNER_TOKEN=abc INPUT_KEEP_COUNT=1)"
assert_contains "Using token from inputs.RUNNER_TOKEN" "$output"
assert_contains "keep_versions=1" "$output"
assert_contains "keep_count=1" "$output"
assert_contains "request_id=req-123" "$output"
assert_contains "Deleted package pkg-a version 1.0.0 -> 204 No Content" "$output"
output="$(run_entrypoint GITEA_TOKEN=secret INPUT_KEEP_VERSIONS=1)"
output="$(run_entrypoint GITEA_TOKEN=secret INPUT_KEEP_COUNT=1)"
assert_contains "Using token from secrets.GITEA_TOKEN" "$output"
if run_entrypoint INPUT_KEEP_VERSIONS=-1 >/dev/null 2>&1; then
printf 'Expected invalid keep_versions to fail\n' >&2
if run_entrypoint INPUT_KEEP_COUNT=-1 >/dev/null 2>&1; then
printf 'Expected invalid keep_count to fail\n' >&2
exit 1
fi
@@ -110,6 +110,6 @@ if run_entrypoint >/dev/null 2>&1; then
fi
delete_log="${TMP_DIR}/delete.log"
output="$(MOCK_DELETE_FILE="$delete_log" run_entrypoint INPUT_RUNNER_TOKEN=abc INPUT_KEEP_VERSIONS=1)"
output="$(MOCK_DELETE_FILE="$delete_log" run_entrypoint INPUT_RUNNER_TOKEN=abc INPUT_KEEP_COUNT=1)"
assert_contains "Summary: packages=2 versions=3 kept=2 candidates=1 deleted=1 errors=0" "$output"
assert_contains "DELETE https://gitea.example.com/api/v1/packages/test-owner/nuget/pkg-a/1.0.0" "$(cat "$delete_log")"