cleanup old docker images on registry#180
Merged
mitch10593 merged 2 commits intomainfrom Mar 12, 2026
Merged
Conversation
Contributor
Reviewer's GuideAdds a scheduled GitHub Actions workflow to automatically delete untagged container images from GHCR for backend and frontend packages, and documents the change in the changelog. Flow diagram for scheduled GHCR untagged image cleanup jobflowchart TD
A[Start scheduled or manual workflow] --> B[Initialize job cleanup on ubuntu-latest]
B --> C[Set permissions: packages delete]
C --> D[Create matrix over packages
website-2026-backend
website-2026-frontend]
D --> E[For each package: run actions/delete-package-versions@v5]
E --> F[Configure action
package-name = matrix.package
package-type = container
delete-only-untagged-versions = true
min-versions-to-keep = 5]
F --> G[GHCR deletes matching untagged container images]
G --> H[End]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path=".github/workflows/cleanup-ghcr.yml" line_range="11-12" />
<code_context>
+jobs:
+ cleanup:
+ runs-on: ubuntu-latest
+ permissions:
+ packages: delete
+ strategy:
+ matrix:
</code_context>
<issue_to_address>
**issue (bug_risk):** The `permissions.packages` value should be `write` rather than `delete`, otherwise the workflow may not have the right permissions.
`packages` permissions only support `read` or `write`; `delete` is not valid. `actions/delete-package-versions` requires `packages: write` to delete versions, so this job will likely fail at runtime. Please change this block to:
```yaml
jobs:
cleanup:
permissions:
packages: write
```
(You can keep the permissions scoped at the job level as you have it.)
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by Sourcery
Add scheduled GitHub Actions workflow to regularly clean up untagged Docker images from the container registry and document the change in the changelog.
Bug Fixes:
CI: