feat(prune-pull-requests-images-tags): add preserve-tags-filter#653
Merged
neilime merged 2 commits intohoverkraft-tech:mainfrom Feb 2, 2026
Conversation
Contributor
|
Hi, thank you for creating your PR, we will check it out very soon |
There was a problem hiding this comment.
Pull request overview
This PR adds a preserve-tags-filter feature to the pull request image tag pruning workflow, allowing users to specify a regular expression pattern for tags that should not be deleted during automated cleanup operations.
Changes:
- Added a new
preserve-tags-filterinput parameter to the workflow, action, and implementation - Enhanced tag filtering logic to exclude tags matching the preserve pattern from deletion
- Updated documentation in action.yml to describe the new parameter and its usage
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/workflows/prune-pull-requests-images-tags.yml |
Added preserve-tags-filter input parameter definition and pass-through to the action |
actions/docker/prune-pull-requests-image-tags/action.yml |
Added preserve-tags-filter input with description and passed it to the index.js script |
actions/docker/prune-pull-requests-image-tags/index.js |
Implemented preserve filter logic to filter out matching tags before deletion |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ion and error handling Addresses PR review comments by adding robust regex validation and error handling: - Extract preserve filter logic into dedicated filterPreservedTags function - Validate preserve filter regex before use with try-catch - Use core.setFailed for invalid regex patterns - Handle regex matching errors gracefully with appropriate warnings - Improve code modularity and maintainability
Member
|
Thank you @NikitaCOEUR |
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.
This pull request introduces an enhancement to the Docker image tag pruning workflow and action by adding support for preserving specific tags based on a user-defined regular expression filter. This allows teams to ensure that important tags (like version tags) are not deleted during automated cleanup of pull request image tags.
Enhancements to tag pruning logic:
preserve-tags-filterinput to both the workflow (.github/workflows/prune-pull-requests-images-tags.yml) and the reusable action (actions/docker/prune-pull-requests-image-tags/action.yml), allowing users to specify a regular expression for tags that should never be deleted [1] [2].preserve-tags-filterinput through to the action, ensuring the filter is available during execution [1] [2] [3].index.js) to accept and handle the newpreserveTagsFilterparameter, filtering out tags that match the preserve filter before deletion [1] [2] [3] [4].