Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete by version name #61

Open
ZBAGI opened this issue Jan 17, 2022 · 1 comment
Open

Delete by version name #61

ZBAGI opened this issue Jan 17, 2022 · 1 comment

Comments

@ZBAGI
Copy link

ZBAGI commented Jan 17, 2022

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

@thasso
Copy link

thasso commented Jun 2, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants