Feature request: Support deleting packages older than X days
Would like to suggest a feature where packages can be deleted that are older than X days.
Similar to this action for purging artifacts:
- uses: kolpav/purge-artifacts-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
expire-in: 7days
Hi @mkrakowitzer,
I think that is a great idea. I will work on adding this feature.
Hi!
It will be nice to have such possibility. Do you have anyETA for this feature?
@trent-j I was wondering if you had a chance to work on this? Its the only thing stopping us from using this action.
Hi!
Any news on this?
Yes, would like to setup package deletion rule like this:
- Keep the N most recent versions, and
- keep all versions created in the past Y months.
(and delete all other versions)
Currently I am keeping the 3 lates pre-release packages with:
min-versions-to-keep: 3
delete-only-pre-release-versions: 'true'
I would really love to be able to keep the latest week of packages, eg. by setting:
min-days-to-keep: 7
Preferably in combination with versions to keep. This should then keep all pre-release packages from the last 7 days, and at a minimum 3 packages. If only two packages are published the last week, one even older packages is kept:
min-versions-to-keep: 3
min-days-to-keep: 7
delete-only-pre-release-versions: 'true'
When looking into this, it seems that timestamp for version/package is not available. The action is using GraphQL to run a query to get repository/packages/edges/node/versions with the properties id and version. There are other fields available, but none for publish timestamp of package.
Will we have to wait until GraphQL implements returning a property for publish timestamp before this issue can be considered?
Any plans to add this support?
+1
@jidicula, does this request seem like a reasonable change that someone could grab and implement?
It does appears as if the logic for delete-oldest-x-number-of-versions-of-a-package has access to created_at for a package (if (a.created_at === b.created_at)) and one would assume that this would make it possible to add logic that could delete anything created after some date.
even just introducing checkboxes for a mass delete would be huge. the web UI is really clunky and deleting the packages can seemingly done individually - after any given deletion, it jumps to the first page and the newest packages... a lot of scrolling and clicking after being warned of 75% storage usage from GitHub automated emails. trying to figure out if there's a smarter way to avoid this...