Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove 20 package limit #36

Merged
merged 1 commit into from
Oct 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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