Add ignoreTags support to exclude old versions from packaging (#118)
* Add ignoreTags support to exclude old versions from packaging Co-authored-by: TingluoHuang <[email protected]> * Add ignoreTags support to add-action and update-action scripts Co-authored-by: TingluoHuang <[email protected]> * Fix JSDoc typo and add regex validation for ignore-tags patterns Co-authored-by: TingluoHuang <[email protected]> * Simplify --ignore-tags to accept version prefixes instead of regex patterns Co-authored-by: TingluoHuang <[email protected]> * Add helper script to add ignoreTags to existing actions and fix JSON syntax in README Co-authored-by: TingluoHuang <[email protected]> * Remove --all flag from add-ignore-tags.sh, require specific action Co-authored-by: TingluoHuang <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: TingluoHuang <[email protected]>
This commit is contained in:
@@ -26,6 +26,12 @@ class ActionConfig {
|
||||
*/
|
||||
patterns = []
|
||||
|
||||
/**
|
||||
* Tag patterns to ignore during packaging
|
||||
* @type {string[]|undefined}
|
||||
*/
|
||||
ignoreTags = undefined
|
||||
|
||||
/**
|
||||
* Branch versions (ref to commit SHA)
|
||||
* @type {{[ref: string]: string}}
|
||||
@@ -63,12 +69,13 @@ exports.TagVersion = TagVersion
|
||||
/**
|
||||
* Adds a new action config file
|
||||
* @param {string} owner
|
||||
* @param {string} repos
|
||||
* @param {string} repo
|
||||
* @param {string[]} patternStrings
|
||||
* @param {string} defaultBranch
|
||||
* @param {string[]|undefined} ignoreTags
|
||||
* @returns {Promise}
|
||||
*/
|
||||
async function add(owner, repo, patternStrings, defaultBranch) {
|
||||
async function add(owner, repo, patternStrings, defaultBranch, ignoreTags) {
|
||||
assert.ok(owner, "Arg 'owner' must not be empty")
|
||||
assert.ok(repo, "Arg 'repo' must not be empty")
|
||||
assert.ok(patternStrings, "Arg 'patternStrings' must not be null")
|
||||
@@ -84,6 +91,9 @@ async function add(owner, repo, patternStrings, defaultBranch) {
|
||||
config.owner = owner
|
||||
config.repo = repo
|
||||
config.patterns = patternStrings
|
||||
if (ignoreTags && ignoreTags.length > 0) {
|
||||
config.ignoreTags = ignoreTags
|
||||
}
|
||||
config.defaultBranch = defaultBranch
|
||||
|
||||
const tempDir = path.join(paths.temp, `${owner}_${repo}`)
|
||||
|
||||
Reference in New Issue
Block a user