Skip to content

Commit

Permalink
👷 Add untagged image removal to organisation
Browse files Browse the repository at this point in the history
  • Loading branch information
Poeschl committed Sep 15, 2024
1 parent cf41d60 commit a4cbf7b
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/untagged-image-removal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Remove all untagged images from all packages
on:
workflow_dispatch:
push:
branches:
- main
schedule:
- cron: '0 23 * * *'

jobs:
build:
name: Remove all untagged images from my packages
runs-on: ubuntu-latest
steps:
- name: 🔑 GHCR Login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.IMAGE_REMOVAL_PAT_TOKEN }}

- name: Delete all untagged images
id: deleted-action
uses: Chizkiyahu/delete-untagged-ghcr-action@main
with:
token: ${{ secrets.IMAGE_REMOVAL_PAT_TOKEN }}
repository_owner: ${{ github.repository_owner }}
untagged_only: true
owner_type: org
except_untagged_multiplatform: true

- name: Output cleaned up images
run: |
echo "## :wastebasket: Summary" >> $GITHUB_STEP_SUMMARY
echo 'Deleted images count: <strong>${{ steps.deleted-action.outputs.num_deleted }}</strong>' >> $GITHUB_STEP_SUMMARY

0 comments on commit a4cbf7b

Please sign in to comment.