ghcr-delete-image-action icon indicating copy to clipboard operation
ghcr-delete-image-action copied to clipboard

Support user owner

Open mr-linch opened this issue 3 years ago • 4 comments

At now only organization packages is supported, we need to add user packages support.

mr-linch avatar May 20 '21 10:05 mr-linch

Any news on this? Support for owner and untagged images would be nice!

kinoute avatar Oct 08 '21 17:10 kinoute

@kinoute Untagged images was released in v1.1.0.

vlussenburg avatar Feb 23 '23 20:02 vlussenburg

See #168 for an implementation.

You should be able to test using:

  delete-untagged-images:
    permissions:
      packages: write

    name: Delete Untagged Images
    runs-on: ubuntu-latest
    steps:
      - uses: lazyfrosch/ghcr-delete-image-action@main
        # uses: bots-house/[email protected]
        with:
          owner: some-username
          name: some-package
          is_user: true
          token: ${{ secrets.GITHUB_TOKEN }}
          untagged-keep-latest: 3

lazyfrosch avatar Mar 26 '23 11:03 lazyfrosch

I fixed this in a new project. https://github.com/dataaxiom/ghcr-cleanup-action. However, to implement this you can lookup the repository from the octokit api and test if it's an organization or a user project type. So you don't have to hard code it in the action setup.

rohanmars avatar May 13 '24 00:05 rohanmars