delete-package-versions
delete-package-versions copied to clipboard
Delete oldest x number of versions of a package but keep a minimum
Honestly this could probably be more easily accomplished with implementing https://github.com/actions/delete-package-versions/issues/5 (keep only N latest versions of package) but how would I keep a minimum number of versions of a package?
If I just use the example:
- uses: actions/delete-package-versions@v1
with:
package-name: 'test-package'
num-old-versions-to-delete: 10
This would delete the 10 oldest versions. But what if I only have 8 versions?
What if I want to at least keep the last three versions around?
For people subscribed to this thread, someone already wrote a PR implementing this: https://github.com/actions/delete-package-versions/pull/29
My use case is always to keep few versions and never to delete a fixed number of versions whatever remains. Then I have used https://github.com/marketplace/actions/remove-package-versions-from-github-packages although it runs on Linux only.
This should be implemented in the latest version of this action. I think this can be closed.