refactor: remove dry run support

This commit is contained in:
2026-05-15 02:18:40 +00:00
parent 68e7842586
commit c923a6ce55
4 changed files with 12 additions and 64 deletions
+5 -7
View File
@@ -90,14 +90,13 @@ run_entrypoint() {
write_mock_curl
output="$(run_entrypoint INPUT_RUNNER_TOKEN=abc INPUT_KEEP_VERSIONS=1 INPUT_DRY_RUN=true)"
output="$(run_entrypoint INPUT_RUNNER_TOKEN=abc INPUT_KEEP_VERSIONS=1)"
assert_contains "Using token from inputs.RUNNER_TOKEN" "$output"
assert_contains "keep_versions=1" "$output"
assert_contains "dry_run=true" "$output"
assert_contains "request_id=req-123" "$output"
assert_contains "[DRY-RUN] Would delete package pkg-a version 1.0.0" "$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 INPUT_DRY_RUN=true)"
output="$(run_entrypoint GITEA_TOKEN=secret INPUT_KEEP_VERSIONS=1)"
assert_contains "Using token from secrets.GITEA_TOKEN" "$output"
if run_entrypoint INPUT_KEEP_VERSIONS=-1 >/dev/null 2>&1; then
@@ -111,7 +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 INPUT_DRY_RUN=false)"
assert_contains "Deleted package pkg-a version 1.0.0 -> 204 No Content" "$output"
assert_contains "Summary: packages=2 versions=3 kept=2 candidates=1 deleted=1 skipped=0 errors=0 dry_run=false" "$output"
output="$(MOCK_DELETE_FILE="$delete_log" run_entrypoint INPUT_RUNNER_TOKEN=abc INPUT_KEEP_VERSIONS=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")"