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

Ignore-Versions parameter is not support for random version numbers. #89

Open
manojKumar-L opened this issue Jan 24, 2023 · 1 comment

Comments

@manojKumar-L
Copy link

manojKumar-L commented Jan 24, 2023

Hi, I have tried to delete the packages with the random version numbers like 3.5.4, 3.6.5, 3.7.21, and 3.8.6 in the ignore-versions parameter. It deletes all the packages in my repository except the latest version. As Guideline said, we need to use the regex for the ignore-versions parameter, but there are fewer possibilities to use the regex in our case. Is there any option to pass the random versions in the ignore-versions parameter?

My Workflow:

name: Removing old artifacts
on:
  registry_package:
    types: [published]
jobs:
  delete-old-packages:
    runs-on: ubuntu-latest
    steps:
      - name: Delete package
        uses: actions/delete-package-versions@v4
        with:
          package-name:  com.sample.test.app
          package-type: maven
          token: ${{ secrets.TOKEN }}
          min-versions-to-keep: 1
          ignore-versions: 2.3.6 

I tried to pass the ignore-versions parameter like below:
ignore-versions: '2.3.6,2.3.1,2.3.5'
ignore-versions: "2.3.6,2.3.1,2.3.5"
ignore-versions: '2.3.6 2.3.1 2.3.5'
ignore-versions: 2.3.6, 2.3.1, 2.3.5

@GMZwinge
Copy link

GMZwinge commented Nov 1, 2023

Have you tried this: ignore-versions: '^(2\.3\.6|2\.3\.1|2\.3\.5)$'?

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