GHA workflow for image cleanup#578
Conversation
📝 WalkthroughWalkthroughA new GitHub Actions workflow adds scheduled and manual pruning of container images for the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (1)📓 Common learnings⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (5)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
.github/workflows/container-cleanup.yml (1)
22-28: Consider documenting the retention policy parameters.The retention policy configuration looks reasonable, but consider adding inline comments to document the cleanup strategy:
cut-off: 7d- Delete images older than 7 dayskeep-n-most-recent: 5- Keep at least 5 most recent images regardless of ageimage-tags: "!latest !v*"- Exclude images tagged aslatestor version tags (v*)tag-selection: both- Apply policy to both tagged and untagged imagesThis would help future maintainers understand the cleanup criteria.
🔎 Example with comments
with: account: metaschema-framework image-names: metaschema-cli + # Delete images older than 7 days, but keep at least 5 most recent cut-off: 7d keep-n-most-recent: 5 + # Exclude 'latest' and version tags (v*) from deletion image-tags: "!latest !v*" + # Apply policy to both tagged and untagged images tag-selection: both dry-run: ${{ inputs.dry-run || false }} token: ${{ secrets.GITHUB_TOKEN }}
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/container-cleanup.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Website
- GitHub Check: Code
🔇 Additional comments (2)
.github/workflows/container-cleanup.yml (2)
1-12: LGTM! Well-configured workflow triggers.The combination of scheduled daily runs and manual workflow_dispatch with a dry-run option provides good operational flexibility for testing before actual cleanup.
13-19: LGTM! Proper permissions configuration.The
packages: writepermission is correctly set for deleting container images, following the principle of least privilege.
Committer Notes
Add GHA workflow to prune old OCI images in GHCR as part of #561.
All Submissions:
Have you squashed any non-relevant commits and commit messages? [instructions]Have you set "Allow edits and access to secrets by maintainers"?By submitting a pull request, you are agreeing to provide this contribution under the CC0 1.0 Universal public domain dedication.
Changes to Core Features:
Have you written new tests for your core changes, as applicable?Have you included examples of how to use your new feature(s)?Have you updated all website and readme documentation affected by the changes you made?Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.