Skip to content

Commit

Permalink
fix docs and clean debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
Chizkiyahu committed Sep 28, 2022
1 parent c6977a7 commit afe8e6f
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 13 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ jobs:
needs: add_temp_pkgs2
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry with PAT_TOKEN
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.PAT_TOKEN }}
- uses: ./
with:
token: ${{ secrets.PAT_TOKEN }}
Expand Down
36 changes: 26 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# delete-untagged-ghcr-action V1
# delete-untagged-ghcr-action V2
[![test](https://github.com/Chizkiyahu/delete-untagged-ghcr-action/actions/workflows/test.yml/badge.svg)](https://github.com/Chizkiyahu/delete-untagged-ghcr-action/actions/workflows/test.yml)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/94534b5b1d7c4c938149bde7dc6d18e2)](https://www.codacy.com/gh/Chizkiyahu/delete-untagged-ghcr-action/dashboard?utm_source=github.com&utm_medium=referral&utm_content=Chizkiyahu/delete-untagged-ghcr-action&utm_campaign=Badge_Grade)

Expand All @@ -10,7 +10,7 @@ delete all / untagged ghcr containers in a repository
<!-- start usage -->
```yaml
- name: Delete untagged ghcr
uses: Chizkiyahu/delete-untagged-ghcr-action@v1
uses: Chizkiyahu/delete-untagged-ghcr-action@v2
with:
# Personal access token (PAT) used to fetch the repository. The PAT is configured
# with the local git config, which enables your scripts to run authenticated git
Expand Down Expand Up @@ -58,7 +58,7 @@ delete all / untagged ghcr containers in a repository
## Delete all owner containers without tags
```yaml
- name: Delete all owner containers without tags
uses: Chizkiyahu/delete-untagged-ghcr-action@v1
uses: Chizkiyahu/delete-untagged-ghcr-action@v2
with:
token: ${{ secrets.PAT_TOKEN }}
repository_owner: ${{ github.repository_owner }}
Expand All @@ -68,7 +68,7 @@ delete all / untagged ghcr containers in a repository
## Delete all owner containers
```yaml
- name: Delete all owner containers
uses: Chizkiyahu/delete-untagged-ghcr-action@v1
uses: Chizkiyahu/delete-untagged-ghcr-action@v2
with:
token: ${{ secrets.PAT_TOKEN }}
repository_owner: ${{ github.repository_owner }}
Expand All @@ -79,7 +79,7 @@ delete all / untagged ghcr containers in a repository
## Delete all containers from repository without tags
```yaml
- name: Delete all containers from repository without tags
uses: Chizkiyahu/delete-untagged-ghcr-action@v1
uses: Chizkiyahu/delete-untagged-ghcr-action@v2
with:
token: ${{ secrets.PAT_TOKEN }}
repository_owner: ${{ github.repository_owner }}
Expand All @@ -91,8 +91,16 @@ delete all / untagged ghcr containers in a repository

## Delete all containers from repository without tags except untagged multiplatform packages
```yaml
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry with PAT_TOKEN
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.PAT_TOKEN }}
- name: Delete all containers from repository without tags
uses: Chizkiyahu/delete-untagged-ghcr-action@v1
uses: Chizkiyahu/delete-untagged-ghcr-action@v2
with:
token: ${{ secrets.PAT_TOKEN }}
repository_owner: ${{ github.repository_owner }}
Expand All @@ -107,7 +115,7 @@ delete all / untagged ghcr containers in a repository
## Delete all containers from repository
```yaml
- name: Delete all containers from repository
uses: Chizkiyahu/delete-untagged-ghcr-action@v1
uses: Chizkiyahu/delete-untagged-ghcr-action@v2
with:
token: ${{ secrets.PAT_TOKEN }}
repository_owner: ${{ github.repository_owner }}
Expand All @@ -119,7 +127,7 @@ delete all / untagged ghcr containers in a repository
## Delete all containers from package without tags
```yaml
- name: Delete all containers from package without tags
uses: Chizkiyahu/delete-untagged-ghcr-action@v1
uses: Chizkiyahu/delete-untagged-ghcr-action@v2
with:
token: ${{ secrets.PAT_TOKEN }}
repository_owner: ${{ github.repository_owner }}
Expand All @@ -131,8 +139,16 @@ delete all / untagged ghcr containers in a repository
## Delete all containers from package without tags except untagged multiplatform packages
```yaml
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry with PAT_TOKEN
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.PAT_TOKEN }}
- name: Delete all containers from package without tags
uses: Chizkiyahu/delete-untagged-ghcr-action@v1
uses: Chizkiyahu/delete-untagged-ghcr-action@v2
with:
token: ${{ secrets.PAT_TOKEN }}
repository_owner: ${{ github.repository_owner }}
Expand All @@ -146,7 +162,7 @@ delete all / untagged ghcr containers in a repository
## Delete all containers from package
```yaml
- name: Delete all containers from package
uses: Chizkiyahu/delete-untagged-ghcr-action@v1
uses: Chizkiyahu/delete-untagged-ghcr-action@v2
with:
token: ${{ secrets.PAT_TOKEN }}
repository_owner: ${{ github.repository_owner }}
Expand Down
3 changes: 0 additions & 3 deletions clean_ghcr.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,6 @@ def delete_pkgs(owner, repo_name, owner_type, package_name, untagged_only,
all_packages = [
pkg_ver for pkg in all_packages for pkg_ver in all_packages[pkg]
]
print(f"all_packages: {all_packages}")
print(f"tagged_pkgs: {tagged_pkgs}")
print(f"deps_pkgs: {deps_pkgs}")
packages = [
pkg for pkg in all_packages
if not pkg["metadata"]["container"]["tags"]
Expand Down

0 comments on commit afe8e6f

Please sign in to comment.