delete-package-versions icon indicating copy to clipboard operation
delete-package-versions copied to clipboard

Feature request: Support deleting packages older than X days

Open mkrakowitzer opened this issue 5 years ago • 11 comments

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

mkrakowitzer avatar Mar 10 '20 22:03 mkrakowitzer

Hi @mkrakowitzer,

I think that is a great idea. I will work on adding this feature.

trent-j avatar Mar 12 '20 14:03 trent-j

Hi!

It will be nice to have such possibility. Do you have anyETA for this feature?

BartoszF avatar May 21 '20 13:05 BartoszF

@trent-j I was wondering if you had a chance to work on this? Its the only thing stopping us from using this action.

mkrakowitzer avatar Jun 25 '20 09:06 mkrakowitzer

Hi!

Any news on this?

smarmn avatar Sep 09 '20 15:09 smarmn

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)

sandstrom avatar Jan 13 '22 21:01 sandstrom

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'

Gakk avatar May 24 '22 12:05 Gakk

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?

Gakk avatar May 24 '22 19:05 Gakk

Any plans to add this support?

raoganeshr avatar Sep 11 '23 08:09 raoganeshr

+1

astanway avatar Sep 14 '23 10:09 astanway

@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.

spkane avatar Mar 06 '24 20:03 spkane

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...

klovelyPhraseHealth avatar Apr 18 '24 18:04 klovelyPhraseHealth