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-only-pre-release-versions: true tag as well as ignore-versions params is not working #121

Open
sagarc05 opened this issue Dec 14, 2023 · 2 comments

Comments

@sagarc05
Copy link

As part of our github action, we have set the delete-only-pre-release-versions tag as true. However the package is not able to differentiate between release and pre-release. Even the release packages are getting deleted.
Our semver for the release package is like 1.12.0. I noticed that in the code it matches with regex ^(0|[1-9]\d*)((\.(0|[1-9]\d*))*)$.
Even then it's deleting all the packages.
action file:
package-name: 'abc'
package-type: 'container'
token: ${{ secrets.GITHUB_TOKEN }}
min-versions-to-keep: 8
delete-only-pre-release-versions: true

We also tried setting ignore versions explicitly. However, its still deletes the packages.
action file:
package-name: 'abc'
package-type: 'container'
token: ${{ secrets.GITHUB_TOKEN }}
min-versions-to-keep: 8
ignore-versions: '^(0|[1-9]\d*)((\.(0|[1-9]\d*))*)$'

@VitaSokolova
Copy link

VitaSokolova commented Jan 22, 2024

In my case it refuses deleting anything at all:

jobs:
  cleanup:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      packages: write
    env:
      TOKEN: ${{ secrets.TOKEN }}
    steps:
      - name: Delete Oldest Package Versions
        uses: actions/delete-package-versions@v4
        with:
          package-name: 'xxx'
          package-type: 'maven'
          min-versions-to-keep: 5
          delete-only-pre-release-versions: 'true'  <---- without this line old packages were deleted
          token: ${{ env.TOKEN }}

@rlaveycal
Copy link

See #88

The code currently filters on "name", which for packages is the version but for containers is the SHA...so nothing matches the ignore regex and everything is deleted

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

3 participants