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

[Feature Request] Support multiple packages

Open Niek opened this issue 2 years ago • 9 comments

Right now just a single package is supported with package-name. I tried specifying a list but that doesn't work. It would be great if multiple packages could be supported.

Niek avatar Feb 26 '22 12:02 Niek

Hey @Niek great idea but I believe action matrices might come in handy for this ask. With matrices you can configure your workflow to run on multiple packages in parallel and even customise the workflow further.

NamrataJha avatar Mar 02 '22 08:03 NamrataJha

@NamrataJha Matrices work great, but they require a separate job with matrix strategy to clean up the packages (instead of a single step inside a job). But I do understand if you don't want to clutter the code with supporting multiple package names.

Niek avatar Mar 03 '22 20:03 Niek

I have developed this feature in a fork. I am aware of action matrices, and the code clutter that will be added to the code. But I still believe it is worth the price as it can simplify this action's configuration.

OmarCastro avatar Apr 04 '22 14:04 OmarCastro

Hello @NamrataJha, did you already analyzed the PR from @OmarCastro? It will be integrated?

carlos-m-rodrigues avatar Apr 05 '22 09:04 carlos-m-rodrigues

Hey @carlos-m-rodrigues @OmarCastro need some time for this. Will take a look in the week of April 18.

NamrataJha avatar Apr 08 '22 10:04 NamrataJha

Hi @NamrataJha is there any update in this subject?

carlos-m-rodrigues avatar Apr 29 '22 22:04 carlos-m-rodrigues

I came here looking for multi package deletion suport - but with matrixes I think this is not really required - since you can do this:

name: Cleanup packages

on:
  schedule:
  - cron: "0 5 * * *"

  workflow_dispatch:

jobs:
  clean:
    strategy:
      matrix:
        package: ['First.Id.Of.Package', 'Second.Id.Of.Package']
    runs-on: ubuntu-latest

    steps:
      - name: Delete Package
        uses: actions/delete-package-versions@v3
        with: 
          package-name: ${{ matrix.package }}
          min-versions-to-keep: 10
          delete-only-pre-release-versions: "false"

So unless you want to clean packages as part of a ci pipeline - I don't think its such a big issue :-)

But anyway - the above is an example until/if its natively supported

bjornbouetsmith avatar Sep 30 '22 13:09 bjornbouetsmith

What about just supporting a regex for all (string) input?

hfhbd avatar Nov 20 '22 12:11 hfhbd

The difference of deleting multiple packages via matrixes is billable time.

We are cleaning 32 different old packages via matrix and the result is: image

And if we clean all packages in a single job: image

utrescu avatar Feb 21 '24 11:02 utrescu