diff --git a/__tests__/delete.test.ts b/__tests__/delete.test.ts index 2f86a85..093368f 100644 --- a/__tests__/delete.test.ts +++ b/__tests__/delete.test.ts @@ -24,7 +24,7 @@ describe('index tests -- call rest', () => { it('finalIds test - supplied package version id', done => { const suppliedIds = ['123', '456', '789'] finalIds(getInput({packageVersionIds: suppliedIds})).subscribe(ids => { - expect(ids).toBe(suppliedIds) + expect(ids).toStrictEqual(suppliedIds) done() }) }) diff --git a/action.yml b/action.yml index 03e8eb0..67192dc 100644 --- a/action.yml +++ b/action.yml @@ -15,12 +15,6 @@ inputs: Defaults to the owner of the repo running the action. required: false - repo: - description: > - Repo containing the package version to delete. - Defaults to the repo running the action. - required: false - package-name: description: > Name of the package containing the version to delete. diff --git a/dist/index.js b/dist/index.js index 40d89e0..4d387e5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -22,7 +22,8 @@ function getVersionIds(owner, packageName, packageType, numVersions, page, token exports.getVersionIds = getVersionIds; function finalIds(input) { if (input.packageVersionIds.length > 0) { - return (0, rxjs_1.of)(input.packageVersionIds); + const toDelete = Math.min(input.packageVersionIds.length, exports.RATE_LIMIT); + return (0, rxjs_1.of)(input.packageVersionIds.slice(0, toDelete)); } if (input.hasOldestVersionQueryInfo()) { return getVersionIds(input.owner, input.packageName, input.packageType, exports.RATE_LIMIT, 1, input.token).pipe( diff --git a/src/delete.ts b/src/delete.ts index b078fea..e701c16 100644 --- a/src/delete.ts +++ b/src/delete.ts @@ -47,7 +47,8 @@ export function getVersionIds( export function finalIds(input: Input): Observable { if (input.packageVersionIds.length > 0) { - return of(input.packageVersionIds) + const toDelete = Math.min(input.packageVersionIds.length, RATE_LIMIT) + return of(input.packageVersionIds.slice(0, toDelete)) } if (input.hasOldestVersionQueryInfo()) { return getVersionIds(