delete-package-versions
delete-package-versions copied to clipboard
Delete by version name
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
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.