Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 8, 2025

This PR implements a way to exclude certain old version tags from being packaged. The solution adds an optional ignoreTags field to the action config JSON files that accepts an array of regex patterns.

Summary of Changes:

Changes:

  1. script/internal/generate-scripts.sh: Read ignoreTags patterns and skip tags that match any pattern during script generation
  2. script/internal/action-config.js: Added ignoreTags property to ActionConfig class and updated add() function to accept and save the field
  3. script/internal/add-action.js: Added --ignore-tags command-line option that accepts simple version prefixes (e.g., v1,v2) and auto-generates the correct regex patterns - no escaping required
  4. script/internal/update-action.js: Modified to preserve ignoreTags when updating existing configs
  5. script/add-ignore-tags.sh & script/internal/add-ignore-tags.js: New helper script to add ignoreTags to existing action configs (one action at a time)
  6. README.md: Updated documentation with usage examples for both CLI option and JSON config

Usage:

When adding a new action:

./script/add-action.sh --ignore-tags "v1,v2" actions/checkout

This auto-generates regex patterns that match v1, v1.x, v2, v2.x, etc.

For existing actions, use the helper script:

./script/add-ignore-tags.sh --ignore-tags "v1,v2" actions/checkout

Or add ignoreTags directly to the JSON config:

{
  "ignoreTags": [
    "^v1(\\..*)?$",
    "^v2(\\..*)?$"
  ]
}

The ignoreTags field is preserved when running update-action.sh.

Original prompt

This section details on the original issue you should resolve

<issue_title>Allow the system to remove certain old versions from the package.</issue_title>
<issue_description>Currently, the script will package all release tags in the config/actions/*.json.

We want to have a way to make the system to ignore certain old version tags.

ex: we don't need to package all the v2 and v2.* tags</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 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.

Copilot AI changed the title [WIP] Allow the system to remove certain old versions from package Add ignoreTags support to exclude old versions from packaging Dec 8, 2025
Copilot AI requested a review from TingluoHuang December 8, 2025 17:15
Copilot AI and others added 6 commits December 8, 2025 18:11
Co-authored-by: TingluoHuang <1750815+TingluoHuang@users.noreply.github.com>
Co-authored-by: TingluoHuang <1750815+TingluoHuang@users.noreply.github.com>
Co-authored-by: TingluoHuang <1750815+TingluoHuang@users.noreply.github.com>
…tterns

Co-authored-by: TingluoHuang <1750815+TingluoHuang@users.noreply.github.com>
…syntax in README

Co-authored-by: TingluoHuang <1750815+TingluoHuang@users.noreply.github.com>
Co-authored-by: TingluoHuang <1750815+TingluoHuang@users.noreply.github.com>
@TingluoHuang TingluoHuang force-pushed the copilot/remove-old-version-tags branch from 5cd80ac to d130220 Compare December 8, 2025 23:12
@TingluoHuang TingluoHuang marked this pull request as ready for review December 8, 2025 23:12
@TingluoHuang TingluoHuang requested a review from a team as a code owner December 8, 2025 23:12
Copilot AI review requested due to automatic review settings December 8, 2025 23:12
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for excluding old version tags from being packaged while still keeping them in the configuration for historical reference. It introduces an optional ignoreTags field in action config JSON files that accepts regex patterns to filter out tags during script generation.

  • Added ignoreTags field to action config schema with proper handling across all scripts
  • Implemented CLI option --ignore-tags that auto-generates regex patterns from simple version prefixes
  • Created helper script add-ignore-tags.sh for adding ignore patterns to existing actions
  • Updated documentation with clear usage examples

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
script/internal/generate-scripts.sh Implements tag filtering logic using regex patterns from ignoreTags field
script/internal/action-config.js Adds ignoreTags property to ActionConfig class and updates add() function signature; fixes JSDoc typo
script/internal/add-action.js Adds --ignore-tags CLI option with regex pattern generation from version prefixes
script/internal/update-action.js Preserves ignoreTags field when updating existing configs
script/internal/add-ignore-tags.js New helper script to add ignore tags to existing action configs with duplicate prevention
script/add-ignore-tags.sh New bash wrapper script that calls add-ignore-tags.js and regenerates scripts
README.md Documents the new ignoreTags feature with usage examples for both new and existing actions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@TingluoHuang TingluoHuang merged commit ab7f3a1 into main Dec 9, 2025
10 checks passed
@TingluoHuang TingluoHuang deleted the copilot/remove-old-version-tags branch December 9, 2025 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow the system to remove certain old versions from the package.

3 participants