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

Delete by version name

Open ZBAGI opened this issue 3 years ago • 1 comments

Would be nice to have an option to delete version by version name (not version id which is hard to fetch based on name). In my workflow I publish packages upon new release based on tag name. And upon release deletion I remove tag and associated with it deployed version. Currently I has to resort to regex negative look-ahead to achieve this feature:

- name: Delete published package
  uses: actions/delete-package-versions@v2
  with:
    package-name: "${{ github.event.repository.name }}"
    ignore-versions: ^(?!${{ github.event.release.tag_name }}).*$
    token: ${{ secrets.GITHUB_TOKEN }}

Since you already checking version names via regex, wouldn't it be easy to implement package-version-names which would work same way as package-version-ids except would match version names ?

Thanks in advance

ZBAGI avatar Jan 17 '22 19:01 ZBAGI

We wrote an action https://github.com/castlabs/get-package-version-id-action to search for the package ids based on the version name. The main reason was to combine it with delete-package-versions to remove those versions. Its limited to packages in the repository that runs the workflow currently, but maybe it helps non the less.

thasso avatar Jun 02 '22 22:06 thasso