From 44a343af72ed8bf452eb2bb813acc18af77097d8 Mon Sep 17 00:00:00 2001 From: Markus Heberling Date: Thu, 26 Oct 2023 09:03:01 +0200 Subject: [PATCH] Remove 20 package limit Fixes #32 --- README.md | 4 ++-- src/input.ts | 4 ---- test/input.spec.ts | 39 --------------------------------------- 3 files changed, 2 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index a251e48..eeedeae 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,10 @@ GitHub action for deleting old versions of packages in the GitHub package regist This is very similar to [actions/delete-package-versions](https://github.com/actions/delete-package-versions) but targets a different use case. -The action works by getting at most 20 packages with at most the oldest 100 versions of each, applying the filters (see +The action works by getting a list of packages with at most the oldest 100 versions of each, applying the filters (see table below) on them and then deleting the matching versions. -> If you have more than 100 versions and none of the 100 oldest versions match, no packages will be deleted! +> If you have more than 100 versions and none of the 100 oldest versions match, no package versions will be deleted! ### Inputs diff --git a/src/input.ts b/src/input.ts index 680791c..8c0ac9c 100644 --- a/src/input.ts +++ b/src/input.ts @@ -67,10 +67,6 @@ export function validateInput(input: Input): Input { throw new Error("names cannot be empty") } - if (input.names.length > 20) { - throw new Error("names cannot contain more than 20 items") - } - if (input.versionPattern && input.semverPattern) { throw new Error("Only one of version-pattern and semver-pattern can be specified") } diff --git a/test/input.spec.ts b/test/input.spec.ts index bbb1519..34a4870 100644 --- a/test/input.spec.ts +++ b/test/input.spec.ts @@ -203,45 +203,6 @@ describe("validateInput", () => { }).toThrow() }) - test("too many names", () => { - const input: Input = { - names: [ - "1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "10", - "11", - "12", - "13", - "14", - "15", - "16", - "17", - "18", - "19", - "20", - "21", - ], - keep: 2, - token: "token", - dryRun: true, - user: "user", - organization: "", - rateLimit: true, - type: PackageType.Npm, - } - - expect(() => { - validateInput(input) - }).toThrow() - }) - test("both versionPattern and semverPattern", () => { const input: Input = { names: ["test", "test2"],