Skip to content

Remove all untagged images from all packages #14

Remove all untagged images from all packages

Remove all untagged images from all packages #14

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