fix: clean registry buildcache tags on PR close#90
Open
Conversation
Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Clean registry buildcache on PR merge or close
Clean registry buildcache tags on PR close
Dec 14, 2025
wdconinc
reviewed
Dec 14, 2025
Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
wdconinc
reviewed
Dec 14, 2025
Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
Co-authored-by: wdconinc <4656391+wdconinc@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements automatic cleanup of buildcache container image tags from both ghcr.io and eicweb.phy.anl.gov registries when pull requests are closed or merged. This addresses the issue of buildcache accumulation without timestamps for automatic eviction. The workflow uses the branch slug (GITHUB_REF_POINT_SLUG) to identify and remove all associated buildcache tags.
Key Changes
- Added new
.github/workflows/cleanup-buildcache.ymlworkflow triggered on PR close - Implements deletion logic for both GitHub Container Registry (ghcr.io) and GitLab Container Registry (eicweb.phy.anl.gov)
- Updated build pipeline documentation to describe the automatic cleanup behavior
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
.github/workflows/cleanup-buildcache.yml |
New workflow that cleans up buildcache tags using branch slug pattern matching from both registries when PRs are closed, with manual dispatch option |
docs/build-pipeline.md |
Documents the buildcache cleanup workflow behavior and adds new trigger table section |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Buildcache tags accumulate in container registries (ghcr.io and eicweb.phy.anl.gov) without timestamps for automatic eviction. This adds a workflow to delete them when PRs close or via manual trigger.
Implementation
.github/workflows/cleanup-buildcache.ymltriggers on:pull_request: types[closed]- automatic cleanup when PR closesworkflow_dispatch- manual cleanup with branch slug inputrlespinasse/github-slug-action@v5(for pull_request events) to ensureGITHUB_REF_POINT_SLUGis set-{GITHUB_REF_POINT_SLUG}-GITHUB_REF_POINT_SLUG(derived from branch name):{BUILD_IMAGE}-{GITHUB_REF_POINT_SLUG}-{arch}{BUILD_IMAGE}{ENV}-{BUILD_TYPE}-{GITHUB_REF_POINT_SLUG}-{arch}Example
For a PR from branch "my-feature" (where
GITHUB_REF_POINT_SLUG= "my-feature"), deletes:For manual cleanup via
workflow_dispatch, provide the branch slug (e.g., "old-feature") as input to delete buildcache tags for that branch.The cleanup workflow uses the same
GITHUB_REF_POINT_SLUGvariable as the build-push workflow, ensuring pattern consistency between tag creation and deletion.Authentication uses existing secrets:
GHCR_REGISTRY_TOKENandGITLAB_TOKENDocumentation
Updated
docs/build-pipeline.mdto document cleanup workflow and caching strategy.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.