Conversation
Add GHA workflow that runs once a week on Sunday at midnight UTC and deletes all untagged images.
There was a problem hiding this comment.
Pull request overview
This PR adds a GitHub Actions workflow to automatically clean up untagged container images from GitHub Container Registry (GHCR). The workflow runs weekly on Sundays at midnight UTC and can also be triggered manually via workflow_dispatch. This helps maintain repository hygiene by removing orphaned image versions that are no longer needed.
Changes:
- Added
.github/workflows/cleanup.ymlwith a scheduled job to delete untagged container images using theactions/delete-package-versionsaction
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| on: | ||
| schedule: | ||
| - cron: 0 0 * * 0 # run at midnight every sunday |
There was a problem hiding this comment.
The comment incorrectly capitalizes 'sunday' - it should be 'Sunday' for proper grammar in documentation.
| - cron: 0 0 * * 0 # run at midnight every sunday | |
| - cron: 0 0 * * 0 # run at midnight every Sunday |
| - name: Delete untagged images | ||
| uses: actions/delete-package-versions@v5 | ||
| with: | ||
| package-name: ${{ github.event.repository.name }} |
There was a problem hiding this comment.
The package-name should use 'github.repository' instead of 'github.event.repository.name'. For GitHub Container Registry packages, the full package name includes both the owner and repository name in the format 'owner/repo'. Using only the repository name will cause the action to fail to find the package. This is consistent with how the release workflow references packages using 'github.repository'.
| package-name: ${{ github.event.repository.name }} | |
| package-name: ${{ github.repository }} |
Add GHA workflow that runs once a week on Sunday at midnight UTC and deletes all untagged images.