Skip to content

Commit

Permalink
Remove 20 package limit
Browse files Browse the repository at this point in the history
Fixes #32
  • Loading branch information
tisoft committed Oct 26, 2023
1 parent 0660d3e commit 44a343a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 45 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 0 additions & 4 deletions src/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
39 changes: 0 additions & 39 deletions test/input.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

0 comments on commit 44a343a

Please sign in to comment.