3 Commits

Author SHA1 Message Date
github-actions[bot]
4f6f9add69 Update all (#122)
Co-authored-by: github-actions <github-actions-bot@users.noreply.github.com>
2025-12-29 10:17:13 -05:00
Copilot
ab7f3a1ca8 Add ignoreTags support to exclude old versions from packaging (#118)
* Add ignoreTags support to exclude old versions from packaging

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

* Add ignoreTags support to add-action and update-action scripts

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

* Fix JSDoc typo and add regex validation for ignore-tags patterns

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

* Simplify --ignore-tags to accept version prefixes instead of regex patterns

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

* Add helper script to add ignoreTags to existing actions and fix JSON syntax in README

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

* Remove --all flag from add-ignore-tags.sh, require specific action

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

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: TingluoHuang <1750815+TingluoHuang@users.noreply.github.com>
2025-12-09 10:30:43 -05:00
github-actions[bot]
40447878b4 Update all (#116)
Co-authored-by: github-actions <github-actions-bot@users.noreply.github.com>
2025-12-08 12:15:10 -05:00
17 changed files with 292 additions and 34 deletions

View File

@@ -15,6 +15,39 @@ Preview versions are intentionally excluded. For example: `v2-beta`
Optional args may be supplied to control which refs are included. See `script/add-action.sh --help` for more info.
### Ignoring old versions
To exclude certain old version tags from being packaged, add an `ignoreTags` array to the action config JSON file. Each entry is a regex pattern that will be tested against tag names.
**When adding a new action**, use the `--ignore-tags` option with simple version prefixes:
```bash
./script/add-action.sh --ignore-tags "v1,v2" actions/checkout
```
This will automatically generate regex patterns that match `v1`, `v1.x`, `v2`, `v2.x`, etc.
**For existing actions**, use the helper script to add ignore tags:
```bash
./script/add-ignore-tags.sh --ignore-tags "v1,v2" actions/checkout
```
Or add `ignoreTags` directly to the JSON config file:
```json
{
"owner": "actions",
"repo": "checkout",
"ignoreTags": [
"^v1(\\..*)?$",
"^v2(\\..*)?$"
]
}
```
Tags matching any of the patterns will be excluded from the generated scripts while remaining in the config for historical reference. The `ignoreTags` field is preserved when running `update-action.sh`.
### How to use this in the self-hosted runner?
Please read the doc @kenmuse has put together at: https://www.kenmuse.com/blog/building-github-actions-runner-images-with-an-action-archive-cache/

View File

@@ -6,7 +6,7 @@
"+^v[3-9]+(\\.[0-9]+){0,2}$"
],
"branches": {
"main": "0057852bfaa89a56745cba8c7296529d2fc39830"
"main": "9255dc7a253b0ccc959486e2bca901246202afeb"
},
"defaultBranch": "main",
"tags": {
@@ -135,6 +135,15 @@
},
"v4.3.0": {
"commit": "0057852bfaa89a56745cba8c7296529d2fc39830"
},
"v5": {
"commit": "9255dc7a253b0ccc959486e2bca901246202afeb"
},
"v5.0.0": {
"commit": "a7833574556fa59680c1b7cb190c1735db73ebf0"
},
"v5.0.1": {
"commit": "9255dc7a253b0ccc959486e2bca901246202afeb"
}
}
}

View File

@@ -6,7 +6,7 @@
"+^v[0-9]+(\\.[0-9]+){0,2}$"
],
"branches": {
"main": "71cf2267d89c5cb81562390fa70a37fa40b1305e"
"main": "8e8c483db84b4bee98b60c0593521ed34d9990e8"
},
"defaultBranch": "main",
"tags": {
@@ -116,7 +116,7 @@
"commit": "f43a0e5ff2bd294095638e18286ca9a3d1956744"
},
"v4": {
"commit": "08eba0b27e820071cde6df949e0beb9ba4906955"
"commit": "34e114876b0b11c390a56381ad16ebd13914f8d5"
},
"v4.0.0": {
"commit": "1e31de5234b9f8995739874a8ce0492dc87873e2"
@@ -157,11 +157,26 @@
"v4.3.0": {
"commit": "08eba0b27e820071cde6df949e0beb9ba4906955"
},
"v4.3.1": {
"commit": "34e114876b0b11c390a56381ad16ebd13914f8d5"
},
"v5": {
"commit": "08c6903cd8c0fde910a37f88322edcfb5dd907a8"
"commit": "93cb6efe18208431cddfb8368fd83d5badbf9bfd"
},
"v5.0.0": {
"commit": "08c6903cd8c0fde910a37f88322edcfb5dd907a8"
},
"v5.0.1": {
"commit": "93cb6efe18208431cddfb8368fd83d5badbf9bfd"
},
"v6": {
"commit": "8e8c483db84b4bee98b60c0593521ed34d9990e8"
},
"v6.0.0": {
"commit": "1af3b93b6815bc44a9784bd300feb67ff0d1eeb3"
},
"v6.0.1": {
"commit": "8e8c483db84b4bee98b60c0593521ed34d9990e8"
}
}
}

View File

@@ -6,7 +6,7 @@
"+^v[0-9]+(\\.[0-9]+){0,2}$"
],
"branches": {
"main": "dda4788290998366da86b6a4f497909644397bb2"
"main": "65d868f8d4d85d7d4abb7de0875cde3fcc8798f5"
},
"defaultBranch": "main",
"tags": {
@@ -204,10 +204,13 @@
"commit": "a0853c24544627f65ddf259abe73b1d18a591444"
},
"v6": {
"commit": "2028fbc5c25fe9cf00d9f06a71cc4710d4507903"
"commit": "395ad3262231945c25e8478fd5baf05154b1d79f"
},
"v6.0.0": {
"commit": "2028fbc5c25fe9cf00d9f06a71cc4710d4507903"
},
"v6.1.0": {
"commit": "395ad3262231945c25e8478fd5baf05154b1d79f"
}
}
}

View File

@@ -7,7 +7,7 @@
"-^v1(\\.[0-9]+){0,2}$"
],
"branches": {
"main": "cfd55ca82492758d853442341ad4d8010466803a"
"main": "83679a892e2d95755f2dac6acb0bfd1e9ac5d548"
},
"defaultBranch": "main",
"tags": {
@@ -158,10 +158,13 @@
"commit": "a26af69be951a213d495a4c3e4e4022e16d87065"
},
"v6": {
"commit": "e797f83bcb11b83ae66e0230d6156d7c80228e7c"
"commit": "83679a892e2d95755f2dac6acb0bfd1e9ac5d548"
},
"v6.0.0": {
"commit": "e797f83bcb11b83ae66e0230d6156d7c80228e7c"
},
"v6.1.0": {
"commit": "83679a892e2d95755f2dac6acb0bfd1e9ac5d548"
}
}
}

View File

@@ -6,7 +6,7 @@
"+^v[0-9]+(\\.[0-9]+){0,2}$"
],
"branches": {
"main": "330a01c490aca151604b8cf639adc76d48f6c5d4"
"main": "b7c566a772e6b6bfb58ed0dc250532a479d7789f"
},
"defaultBranch": "main",
"tags": {
@@ -146,6 +146,12 @@
},
"v5.0.0": {
"commit": "330a01c490aca151604b8cf639adc76d48f6c5d4"
},
"v6": {
"commit": "b7c566a772e6b6bfb58ed0dc250532a479d7789f"
},
"v6.0.0": {
"commit": "b7c566a772e6b6bfb58ed0dc250532a479d7789f"
}
}
}

14
script/add-ignore-tags.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/bash
set -e
script_dir="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
# Minimum node version
$script_dir/internal/check-node.sh
# Add ignore tags to the action
node "$script_dir/internal/add-ignore-tags.js" $*
# Regenerate action scripts
$script_dir/internal/generate-scripts.sh

View File

@@ -1,7 +1,7 @@
mkdir actions_cache
pushd actions_cache
curl -s -S -L -o '0057852bfaa89a56745cba8c7296529d2fc39830.tar.gz' 'https://api.github.com/repos/actions/cache/tarball/0057852bfaa89a56745cba8c7296529d2fc39830'
curl -s -S -L -o '0057852bfaa89a56745cba8c7296529d2fc39830.zip' 'https://api.github.com/repos/actions/cache/zipball/0057852bfaa89a56745cba8c7296529d2fc39830'
curl -s -S -L -o '9255dc7a253b0ccc959486e2bca901246202afeb.tar.gz' 'https://api.github.com/repos/actions/cache/tarball/9255dc7a253b0ccc959486e2bca901246202afeb'
curl -s -S -L -o '9255dc7a253b0ccc959486e2bca901246202afeb.zip' 'https://api.github.com/repos/actions/cache/zipball/9255dc7a253b0ccc959486e2bca901246202afeb'
curl -s -S -L -o '6f8efc29b200d32929f49075959781ed54ec270c.tar.gz' 'https://api.github.com/repos/actions/cache/tarball/6f8efc29b200d32929f49075959781ed54ec270c'
curl -s -S -L -o '6f8efc29b200d32929f49075959781ed54ec270c.zip' 'https://api.github.com/repos/actions/cache/zipball/6f8efc29b200d32929f49075959781ed54ec270c'
curl -s -S -L -o '4b0cf6cc4619e737324ddfcec08fff2413359514.tar.gz' 'https://api.github.com/repos/actions/cache/tarball/4b0cf6cc4619e737324ddfcec08fff2413359514'
@@ -86,4 +86,10 @@ curl -s -S -L -o '0400d5f644dc74513175e3cd8d07132dd4860809.tar.gz' 'https://api.
curl -s -S -L -o '0400d5f644dc74513175e3cd8d07132dd4860809.zip' 'https://api.github.com/repos/actions/cache/zipball/0400d5f644dc74513175e3cd8d07132dd4860809'
curl -s -S -L -o '0057852bfaa89a56745cba8c7296529d2fc39830.tar.gz' 'https://api.github.com/repos/actions/cache/tarball/0057852bfaa89a56745cba8c7296529d2fc39830'
curl -s -S -L -o '0057852bfaa89a56745cba8c7296529d2fc39830.zip' 'https://api.github.com/repos/actions/cache/zipball/0057852bfaa89a56745cba8c7296529d2fc39830'
curl -s -S -L -o '9255dc7a253b0ccc959486e2bca901246202afeb.tar.gz' 'https://api.github.com/repos/actions/cache/tarball/9255dc7a253b0ccc959486e2bca901246202afeb'
curl -s -S -L -o '9255dc7a253b0ccc959486e2bca901246202afeb.zip' 'https://api.github.com/repos/actions/cache/zipball/9255dc7a253b0ccc959486e2bca901246202afeb'
curl -s -S -L -o 'a7833574556fa59680c1b7cb190c1735db73ebf0.tar.gz' 'https://api.github.com/repos/actions/cache/tarball/a7833574556fa59680c1b7cb190c1735db73ebf0'
curl -s -S -L -o 'a7833574556fa59680c1b7cb190c1735db73ebf0.zip' 'https://api.github.com/repos/actions/cache/zipball/a7833574556fa59680c1b7cb190c1735db73ebf0'
curl -s -S -L -o '9255dc7a253b0ccc959486e2bca901246202afeb.tar.gz' 'https://api.github.com/repos/actions/cache/tarball/9255dc7a253b0ccc959486e2bca901246202afeb'
curl -s -S -L -o '9255dc7a253b0ccc959486e2bca901246202afeb.zip' 'https://api.github.com/repos/actions/cache/zipball/9255dc7a253b0ccc959486e2bca901246202afeb'
popd

View File

@@ -1,7 +1,7 @@
mkdir actions_checkout
pushd actions_checkout
curl -s -S -L -o '71cf2267d89c5cb81562390fa70a37fa40b1305e.tar.gz' 'https://api.github.com/repos/actions/checkout/tarball/71cf2267d89c5cb81562390fa70a37fa40b1305e'
curl -s -S -L -o '71cf2267d89c5cb81562390fa70a37fa40b1305e.zip' 'https://api.github.com/repos/actions/checkout/zipball/71cf2267d89c5cb81562390fa70a37fa40b1305e'
curl -s -S -L -o '8e8c483db84b4bee98b60c0593521ed34d9990e8.tar.gz' 'https://api.github.com/repos/actions/checkout/tarball/8e8c483db84b4bee98b60c0593521ed34d9990e8'
curl -s -S -L -o '8e8c483db84b4bee98b60c0593521ed34d9990e8.zip' 'https://api.github.com/repos/actions/checkout/zipball/8e8c483db84b4bee98b60c0593521ed34d9990e8'
curl -s -S -L -o '50fbc622fc4ef5163becd7fab6573eac35f8462e.tar.gz' 'https://api.github.com/repos/actions/checkout/tarball/50fbc622fc4ef5163becd7fab6573eac35f8462e'
curl -s -S -L -o '50fbc622fc4ef5163becd7fab6573eac35f8462e.zip' 'https://api.github.com/repos/actions/checkout/zipball/50fbc622fc4ef5163becd7fab6573eac35f8462e'
curl -s -S -L -o 'af513c7a016048ae468971c52ed77d9562c7c819.tar.gz' 'https://api.github.com/repos/actions/checkout/tarball/af513c7a016048ae468971c52ed77d9562c7c819'
@@ -70,8 +70,8 @@ curl -s -S -L -o 'c85c95e3d7251135ab7dc9ce3241c5835cc595a9.tar.gz' 'https://api.
curl -s -S -L -o 'c85c95e3d7251135ab7dc9ce3241c5835cc595a9.zip' 'https://api.github.com/repos/actions/checkout/zipball/c85c95e3d7251135ab7dc9ce3241c5835cc595a9'
curl -s -S -L -o 'f43a0e5ff2bd294095638e18286ca9a3d1956744.tar.gz' 'https://api.github.com/repos/actions/checkout/tarball/f43a0e5ff2bd294095638e18286ca9a3d1956744'
curl -s -S -L -o 'f43a0e5ff2bd294095638e18286ca9a3d1956744.zip' 'https://api.github.com/repos/actions/checkout/zipball/f43a0e5ff2bd294095638e18286ca9a3d1956744'
curl -s -S -L -o '08eba0b27e820071cde6df949e0beb9ba4906955.tar.gz' 'https://api.github.com/repos/actions/checkout/tarball/08eba0b27e820071cde6df949e0beb9ba4906955'
curl -s -S -L -o '08eba0b27e820071cde6df949e0beb9ba4906955.zip' 'https://api.github.com/repos/actions/checkout/zipball/08eba0b27e820071cde6df949e0beb9ba4906955'
curl -s -S -L -o '34e114876b0b11c390a56381ad16ebd13914f8d5.tar.gz' 'https://api.github.com/repos/actions/checkout/tarball/34e114876b0b11c390a56381ad16ebd13914f8d5'
curl -s -S -L -o '34e114876b0b11c390a56381ad16ebd13914f8d5.zip' 'https://api.github.com/repos/actions/checkout/zipball/34e114876b0b11c390a56381ad16ebd13914f8d5'
curl -s -S -L -o '1e31de5234b9f8995739874a8ce0492dc87873e2.tar.gz' 'https://api.github.com/repos/actions/checkout/tarball/1e31de5234b9f8995739874a8ce0492dc87873e2'
curl -s -S -L -o '1e31de5234b9f8995739874a8ce0492dc87873e2.zip' 'https://api.github.com/repos/actions/checkout/zipball/1e31de5234b9f8995739874a8ce0492dc87873e2'
curl -s -S -L -o '8ade135a41bc03ea155e62e844d188df1ea18608.tar.gz' 'https://api.github.com/repos/actions/checkout/tarball/8ade135a41bc03ea155e62e844d188df1ea18608'
@@ -98,8 +98,18 @@ curl -s -S -L -o '11bd71901bbe5b1630ceea73d27597364c9af683.tar.gz' 'https://api.
curl -s -S -L -o '11bd71901bbe5b1630ceea73d27597364c9af683.zip' 'https://api.github.com/repos/actions/checkout/zipball/11bd71901bbe5b1630ceea73d27597364c9af683'
curl -s -S -L -o '08eba0b27e820071cde6df949e0beb9ba4906955.tar.gz' 'https://api.github.com/repos/actions/checkout/tarball/08eba0b27e820071cde6df949e0beb9ba4906955'
curl -s -S -L -o '08eba0b27e820071cde6df949e0beb9ba4906955.zip' 'https://api.github.com/repos/actions/checkout/zipball/08eba0b27e820071cde6df949e0beb9ba4906955'
curl -s -S -L -o '34e114876b0b11c390a56381ad16ebd13914f8d5.tar.gz' 'https://api.github.com/repos/actions/checkout/tarball/34e114876b0b11c390a56381ad16ebd13914f8d5'
curl -s -S -L -o '34e114876b0b11c390a56381ad16ebd13914f8d5.zip' 'https://api.github.com/repos/actions/checkout/zipball/34e114876b0b11c390a56381ad16ebd13914f8d5'
curl -s -S -L -o '93cb6efe18208431cddfb8368fd83d5badbf9bfd.tar.gz' 'https://api.github.com/repos/actions/checkout/tarball/93cb6efe18208431cddfb8368fd83d5badbf9bfd'
curl -s -S -L -o '93cb6efe18208431cddfb8368fd83d5badbf9bfd.zip' 'https://api.github.com/repos/actions/checkout/zipball/93cb6efe18208431cddfb8368fd83d5badbf9bfd'
curl -s -S -L -o '08c6903cd8c0fde910a37f88322edcfb5dd907a8.tar.gz' 'https://api.github.com/repos/actions/checkout/tarball/08c6903cd8c0fde910a37f88322edcfb5dd907a8'
curl -s -S -L -o '08c6903cd8c0fde910a37f88322edcfb5dd907a8.zip' 'https://api.github.com/repos/actions/checkout/zipball/08c6903cd8c0fde910a37f88322edcfb5dd907a8'
curl -s -S -L -o '08c6903cd8c0fde910a37f88322edcfb5dd907a8.tar.gz' 'https://api.github.com/repos/actions/checkout/tarball/08c6903cd8c0fde910a37f88322edcfb5dd907a8'
curl -s -S -L -o '08c6903cd8c0fde910a37f88322edcfb5dd907a8.zip' 'https://api.github.com/repos/actions/checkout/zipball/08c6903cd8c0fde910a37f88322edcfb5dd907a8'
curl -s -S -L -o '93cb6efe18208431cddfb8368fd83d5badbf9bfd.tar.gz' 'https://api.github.com/repos/actions/checkout/tarball/93cb6efe18208431cddfb8368fd83d5badbf9bfd'
curl -s -S -L -o '93cb6efe18208431cddfb8368fd83d5badbf9bfd.zip' 'https://api.github.com/repos/actions/checkout/zipball/93cb6efe18208431cddfb8368fd83d5badbf9bfd'
curl -s -S -L -o '8e8c483db84b4bee98b60c0593521ed34d9990e8.tar.gz' 'https://api.github.com/repos/actions/checkout/tarball/8e8c483db84b4bee98b60c0593521ed34d9990e8'
curl -s -S -L -o '8e8c483db84b4bee98b60c0593521ed34d9990e8.zip' 'https://api.github.com/repos/actions/checkout/zipball/8e8c483db84b4bee98b60c0593521ed34d9990e8'
curl -s -S -L -o '1af3b93b6815bc44a9784bd300feb67ff0d1eeb3.tar.gz' 'https://api.github.com/repos/actions/checkout/tarball/1af3b93b6815bc44a9784bd300feb67ff0d1eeb3'
curl -s -S -L -o '1af3b93b6815bc44a9784bd300feb67ff0d1eeb3.zip' 'https://api.github.com/repos/actions/checkout/zipball/1af3b93b6815bc44a9784bd300feb67ff0d1eeb3'
curl -s -S -L -o '8e8c483db84b4bee98b60c0593521ed34d9990e8.tar.gz' 'https://api.github.com/repos/actions/checkout/tarball/8e8c483db84b4bee98b60c0593521ed34d9990e8'
curl -s -S -L -o '8e8c483db84b4bee98b60c0593521ed34d9990e8.zip' 'https://api.github.com/repos/actions/checkout/zipball/8e8c483db84b4bee98b60c0593521ed34d9990e8'
popd

View File

@@ -1,7 +1,7 @@
mkdir actions_setup-node
pushd actions_setup-node
curl -s -S -L -o 'dda4788290998366da86b6a4f497909644397bb2.tar.gz' 'https://api.github.com/repos/actions/setup-node/tarball/dda4788290998366da86b6a4f497909644397bb2'
curl -s -S -L -o 'dda4788290998366da86b6a4f497909644397bb2.zip' 'https://api.github.com/repos/actions/setup-node/zipball/dda4788290998366da86b6a4f497909644397bb2'
curl -s -S -L -o '65d868f8d4d85d7d4abb7de0875cde3fcc8798f5.tar.gz' 'https://api.github.com/repos/actions/setup-node/tarball/65d868f8d4d85d7d4abb7de0875cde3fcc8798f5'
curl -s -S -L -o '65d868f8d4d85d7d4abb7de0875cde3fcc8798f5.zip' 'https://api.github.com/repos/actions/setup-node/zipball/65d868f8d4d85d7d4abb7de0875cde3fcc8798f5'
curl -s -S -L -o 'f1f314fca9dfce2769ece7d933488f076716723e.tar.gz' 'https://api.github.com/repos/actions/setup-node/tarball/f1f314fca9dfce2769ece7d933488f076716723e'
curl -s -S -L -o 'f1f314fca9dfce2769ece7d933488f076716723e.zip' 'https://api.github.com/repos/actions/setup-node/zipball/f1f314fca9dfce2769ece7d933488f076716723e'
curl -s -S -L -o '0d7d2ca66539aca4af6c5102e29a33757e2c2d2c.tar.gz' 'https://api.github.com/repos/actions/setup-node/tarball/0d7d2ca66539aca4af6c5102e29a33757e2c2d2c'
@@ -130,8 +130,10 @@ curl -s -S -L -o 'a0853c24544627f65ddf259abe73b1d18a591444.tar.gz' 'https://api.
curl -s -S -L -o 'a0853c24544627f65ddf259abe73b1d18a591444.zip' 'https://api.github.com/repos/actions/setup-node/zipball/a0853c24544627f65ddf259abe73b1d18a591444'
curl -s -S -L -o 'a0853c24544627f65ddf259abe73b1d18a591444.tar.gz' 'https://api.github.com/repos/actions/setup-node/tarball/a0853c24544627f65ddf259abe73b1d18a591444'
curl -s -S -L -o 'a0853c24544627f65ddf259abe73b1d18a591444.zip' 'https://api.github.com/repos/actions/setup-node/zipball/a0853c24544627f65ddf259abe73b1d18a591444'
curl -s -S -L -o '395ad3262231945c25e8478fd5baf05154b1d79f.tar.gz' 'https://api.github.com/repos/actions/setup-node/tarball/395ad3262231945c25e8478fd5baf05154b1d79f'
curl -s -S -L -o '395ad3262231945c25e8478fd5baf05154b1d79f.zip' 'https://api.github.com/repos/actions/setup-node/zipball/395ad3262231945c25e8478fd5baf05154b1d79f'
curl -s -S -L -o '2028fbc5c25fe9cf00d9f06a71cc4710d4507903.tar.gz' 'https://api.github.com/repos/actions/setup-node/tarball/2028fbc5c25fe9cf00d9f06a71cc4710d4507903'
curl -s -S -L -o '2028fbc5c25fe9cf00d9f06a71cc4710d4507903.zip' 'https://api.github.com/repos/actions/setup-node/zipball/2028fbc5c25fe9cf00d9f06a71cc4710d4507903'
curl -s -S -L -o '2028fbc5c25fe9cf00d9f06a71cc4710d4507903.tar.gz' 'https://api.github.com/repos/actions/setup-node/tarball/2028fbc5c25fe9cf00d9f06a71cc4710d4507903'
curl -s -S -L -o '2028fbc5c25fe9cf00d9f06a71cc4710d4507903.zip' 'https://api.github.com/repos/actions/setup-node/zipball/2028fbc5c25fe9cf00d9f06a71cc4710d4507903'
curl -s -S -L -o '395ad3262231945c25e8478fd5baf05154b1d79f.tar.gz' 'https://api.github.com/repos/actions/setup-node/tarball/395ad3262231945c25e8478fd5baf05154b1d79f'
curl -s -S -L -o '395ad3262231945c25e8478fd5baf05154b1d79f.zip' 'https://api.github.com/repos/actions/setup-node/zipball/395ad3262231945c25e8478fd5baf05154b1d79f'
popd

View File

@@ -1,7 +1,7 @@
mkdir actions_setup-python
pushd actions_setup-python
curl -s -S -L -o 'cfd55ca82492758d853442341ad4d8010466803a.tar.gz' 'https://api.github.com/repos/actions/setup-python/tarball/cfd55ca82492758d853442341ad4d8010466803a'
curl -s -S -L -o 'cfd55ca82492758d853442341ad4d8010466803a.zip' 'https://api.github.com/repos/actions/setup-python/zipball/cfd55ca82492758d853442341ad4d8010466803a'
curl -s -S -L -o '83679a892e2d95755f2dac6acb0bfd1e9ac5d548.tar.gz' 'https://api.github.com/repos/actions/setup-python/tarball/83679a892e2d95755f2dac6acb0bfd1e9ac5d548'
curl -s -S -L -o '83679a892e2d95755f2dac6acb0bfd1e9ac5d548.zip' 'https://api.github.com/repos/actions/setup-python/zipball/83679a892e2d95755f2dac6acb0bfd1e9ac5d548'
curl -s -S -L -o 'e9aba2c848f5ebd159c070c61ea2c4e2b122355e.tar.gz' 'https://api.github.com/repos/actions/setup-python/tarball/e9aba2c848f5ebd159c070c61ea2c4e2b122355e'
curl -s -S -L -o 'e9aba2c848f5ebd159c070c61ea2c4e2b122355e.zip' 'https://api.github.com/repos/actions/setup-python/zipball/e9aba2c848f5ebd159c070c61ea2c4e2b122355e'
curl -s -S -L -o '6c4e46d258ee4bf9a1263c78a91ec029bbe54cf0.tar.gz' 'https://api.github.com/repos/actions/setup-python/tarball/6c4e46d258ee4bf9a1263c78a91ec029bbe54cf0'
@@ -98,8 +98,10 @@ curl -s -S -L -o '8d9ed9ac5c53483de85588cdf95a591a75ab9f55.tar.gz' 'https://api.
curl -s -S -L -o '8d9ed9ac5c53483de85588cdf95a591a75ab9f55.zip' 'https://api.github.com/repos/actions/setup-python/zipball/8d9ed9ac5c53483de85588cdf95a591a75ab9f55'
curl -s -S -L -o 'a26af69be951a213d495a4c3e4e4022e16d87065.tar.gz' 'https://api.github.com/repos/actions/setup-python/tarball/a26af69be951a213d495a4c3e4e4022e16d87065'
curl -s -S -L -o 'a26af69be951a213d495a4c3e4e4022e16d87065.zip' 'https://api.github.com/repos/actions/setup-python/zipball/a26af69be951a213d495a4c3e4e4022e16d87065'
curl -s -S -L -o '83679a892e2d95755f2dac6acb0bfd1e9ac5d548.tar.gz' 'https://api.github.com/repos/actions/setup-python/tarball/83679a892e2d95755f2dac6acb0bfd1e9ac5d548'
curl -s -S -L -o '83679a892e2d95755f2dac6acb0bfd1e9ac5d548.zip' 'https://api.github.com/repos/actions/setup-python/zipball/83679a892e2d95755f2dac6acb0bfd1e9ac5d548'
curl -s -S -L -o 'e797f83bcb11b83ae66e0230d6156d7c80228e7c.tar.gz' 'https://api.github.com/repos/actions/setup-python/tarball/e797f83bcb11b83ae66e0230d6156d7c80228e7c'
curl -s -S -L -o 'e797f83bcb11b83ae66e0230d6156d7c80228e7c.zip' 'https://api.github.com/repos/actions/setup-python/zipball/e797f83bcb11b83ae66e0230d6156d7c80228e7c'
curl -s -S -L -o 'e797f83bcb11b83ae66e0230d6156d7c80228e7c.tar.gz' 'https://api.github.com/repos/actions/setup-python/tarball/e797f83bcb11b83ae66e0230d6156d7c80228e7c'
curl -s -S -L -o 'e797f83bcb11b83ae66e0230d6156d7c80228e7c.zip' 'https://api.github.com/repos/actions/setup-python/zipball/e797f83bcb11b83ae66e0230d6156d7c80228e7c'
curl -s -S -L -o '83679a892e2d95755f2dac6acb0bfd1e9ac5d548.tar.gz' 'https://api.github.com/repos/actions/setup-python/tarball/83679a892e2d95755f2dac6acb0bfd1e9ac5d548'
curl -s -S -L -o '83679a892e2d95755f2dac6acb0bfd1e9ac5d548.zip' 'https://api.github.com/repos/actions/setup-python/zipball/83679a892e2d95755f2dac6acb0bfd1e9ac5d548'
popd

View File

@@ -1,7 +1,7 @@
mkdir actions_upload-artifact
pushd actions_upload-artifact
curl -s -S -L -o '330a01c490aca151604b8cf639adc76d48f6c5d4.tar.gz' 'https://api.github.com/repos/actions/upload-artifact/tarball/330a01c490aca151604b8cf639adc76d48f6c5d4'
curl -s -S -L -o '330a01c490aca151604b8cf639adc76d48f6c5d4.zip' 'https://api.github.com/repos/actions/upload-artifact/zipball/330a01c490aca151604b8cf639adc76d48f6c5d4'
curl -s -S -L -o 'b7c566a772e6b6bfb58ed0dc250532a479d7789f.tar.gz' 'https://api.github.com/repos/actions/upload-artifact/tarball/b7c566a772e6b6bfb58ed0dc250532a479d7789f'
curl -s -S -L -o 'b7c566a772e6b6bfb58ed0dc250532a479d7789f.zip' 'https://api.github.com/repos/actions/upload-artifact/zipball/b7c566a772e6b6bfb58ed0dc250532a479d7789f'
curl -s -S -L -o '3446296876d12d4e3a0f3145a3c87e67bf0a16b5.tar.gz' 'https://api.github.com/repos/actions/upload-artifact/tarball/3446296876d12d4e3a0f3145a3c87e67bf0a16b5'
curl -s -S -L -o '3446296876d12d4e3a0f3145a3c87e67bf0a16b5.zip' 'https://api.github.com/repos/actions/upload-artifact/zipball/3446296876d12d4e3a0f3145a3c87e67bf0a16b5'
curl -s -S -L -o '3446296876d12d4e3a0f3145a3c87e67bf0a16b5.tar.gz' 'https://api.github.com/repos/actions/upload-artifact/tarball/3446296876d12d4e3a0f3145a3c87e67bf0a16b5'
@@ -92,4 +92,8 @@ curl -s -S -L -o '330a01c490aca151604b8cf639adc76d48f6c5d4.tar.gz' 'https://api.
curl -s -S -L -o '330a01c490aca151604b8cf639adc76d48f6c5d4.zip' 'https://api.github.com/repos/actions/upload-artifact/zipball/330a01c490aca151604b8cf639adc76d48f6c5d4'
curl -s -S -L -o '330a01c490aca151604b8cf639adc76d48f6c5d4.tar.gz' 'https://api.github.com/repos/actions/upload-artifact/tarball/330a01c490aca151604b8cf639adc76d48f6c5d4'
curl -s -S -L -o '330a01c490aca151604b8cf639adc76d48f6c5d4.zip' 'https://api.github.com/repos/actions/upload-artifact/zipball/330a01c490aca151604b8cf639adc76d48f6c5d4'
curl -s -S -L -o 'b7c566a772e6b6bfb58ed0dc250532a479d7789f.tar.gz' 'https://api.github.com/repos/actions/upload-artifact/tarball/b7c566a772e6b6bfb58ed0dc250532a479d7789f'
curl -s -S -L -o 'b7c566a772e6b6bfb58ed0dc250532a479d7789f.zip' 'https://api.github.com/repos/actions/upload-artifact/zipball/b7c566a772e6b6bfb58ed0dc250532a479d7789f'
curl -s -S -L -o 'b7c566a772e6b6bfb58ed0dc250532a479d7789f.tar.gz' 'https://api.github.com/repos/actions/upload-artifact/tarball/b7c566a772e6b6bfb58ed0dc250532a479d7789f'
curl -s -S -L -o 'b7c566a772e6b6bfb58ed0dc250532a479d7789f.zip' 'https://api.github.com/repos/actions/upload-artifact/zipball/b7c566a772e6b6bfb58ed0dc250532a479d7789f'
popd

View File

@@ -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}`)

View File

@@ -14,6 +14,7 @@ async function main() {
const repo = args.repo
const patterns = args.patterns
const defaultBranch = args.defaultBranch || 'master'
const ignoreTags = args.ignoreTags
// File exists?
const file = actionConfig.getFilePath(owner, repo)
@@ -23,7 +24,7 @@ async function main() {
await fsHelper.reinitTemp()
// Add the config
await actionConfig.add(owner, repo, patterns, defaultBranch)
await actionConfig.add(owner, repo, patterns, defaultBranch, ignoreTags)
}
catch (err) {
// Help
@@ -50,6 +51,7 @@ class Args {
repo = ''
patterns = []
defaultBranch = ''
ignoreTags = []
}
/**
@@ -58,7 +60,7 @@ class Args {
*/
function getArgs() {
// Parse
const parsedArgs = argHelper.parse([], ['default-branch'])
const parsedArgs = argHelper.parse([], ['default-branch', 'ignore-tags'])
if (parsedArgs.arguments.length < 1) {
argHelper.throwError('Expected at least one arg')
}
@@ -81,17 +83,32 @@ function getArgs() {
}
}
// Parse ignore-tags (comma-separated version prefixes like v1,v2)
// These are converted to regex patterns that match the version and all its sub-versions
let ignoreTags = []
if (parsedArgs.options['ignore-tags']) {
const prefixes = parsedArgs.options['ignore-tags'].split(',').map(t => t.trim()).filter(t => t)
for (const prefix of prefixes) {
// Convert simple version prefix like "v1" to regex pattern "^v1(\\..*)?$"
// This matches "v1", "v1.0", "v1.0.0", etc.
const escapedPrefix = prefix.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
ignoreTags.push(`^${escapedPrefix}(\\..*)?$`)
}
}
return {
owner: splitNwo[0],
repo: splitNwo[1],
patterns: patterns,
defaultBranch: parsedArgs.options['default-branch']
defaultBranch: parsedArgs.options['default-branch'],
ignoreTags: ignoreTags
}
}
function printUsage() {
console.error('USAGE: add-action.sh [--default-branch branch] nwo [(+|-)regexp [...]]')
console.error('USAGE: add-action.sh [--default-branch branch] [--ignore-tags versions] nwo [(+|-)regexp [...]]')
console.error(` --default-branch Default branch name. For example: master`)
console.error(` --ignore-tags Comma-separated version prefixes to ignore. For example: v1,v2`)
console.error(` nwo Name with owner. For example: actions/checkout`)
console.error(` regexp Refs to include or exclude. Default: ${actionConfig.defaultPatterns.join(' ')}`)
}

View File

@@ -0,0 +1,105 @@
const actionConfig = require('./action-config')
const argHelper = require('./arg-helper')
const debugHelper = require('./debug-helper')
const fs = require('fs')
async function main() {
try {
// Command line args
const args = getArgs()
// Get the action config file
const file = actionConfig.getFilePath(args.owner, args.repo)
debugHelper.debug(`file: ${file}`)
// Load the config
const config = await actionConfig.loadFromPath(file)
// Add ignore tags
if (!config.ignoreTags) {
config.ignoreTags = []
}
// Add new patterns (avoid duplicates)
for (const pattern of args.ignoreTags) {
if (!config.ignoreTags.includes(pattern)) {
config.ignoreTags.push(pattern)
}
}
// Write config back
await fs.promises.writeFile(file, JSON.stringify(config, null, ' '))
console.log(`Updated config file: ${file}`)
console.log(` ignoreTags: ${JSON.stringify(config.ignoreTags)}`)
}
catch (err) {
// Help
if (err.code === argHelper.helpCode) {
printUsage()
return
}
// Arg error?
if (err.code === argHelper.errorCode) {
printUsage()
console.error('')
}
// Print error
debugHelper.debug(err.stack)
console.error(`ERROR: ${err.message}`)
process.exitCode = 1
}
}
class Args {
owner = ''
repo = ''
ignoreTags = []
}
/**
* Get the command line args
* @returns {Args}
*/
function getArgs() {
const parsedArgs = argHelper.parse([], ['ignore-tags'])
const result = new Args()
// Validate ignore-tags is provided
if (!parsedArgs.options['ignore-tags']) {
argHelper.throwError('--ignore-tags is required')
}
// Parse ignore-tags (comma-separated version prefixes like v1,v2)
const prefixes = parsedArgs.options['ignore-tags'].split(',').map(t => t.trim()).filter(t => t)
for (const prefix of prefixes) {
// Convert simple version prefix like "v1" to regex pattern "^v1(\\..*)?$"
// This matches "v1", "v1.0", "v1.0.0", etc.
const escapedPrefix = prefix.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')
result.ignoreTags.push(`^${escapedPrefix}(\\..*)?$`)
}
// Validate exactly one arg
if (parsedArgs.arguments.length !== 1) {
argHelper.throwError('Expected exactly one arg (nwo)')
}
const nwo = parsedArgs.arguments[0]
const splitNwo = nwo.split('/')
if (splitNwo.length !== 2 || !splitNwo[0] || !splitNwo[1]) {
argHelper.throwError(`Invalid nwo '${nwo}'`)
}
result.owner = splitNwo[0]
result.repo = splitNwo[1]
return result
}
function printUsage() {
console.error('USAGE: add-ignore-tags.sh --ignore-tags versions nwo')
console.error(` --ignore-tags Comma-separated version prefixes to ignore. For example: v1,v2`)
console.error(` nwo Name with owner. For example: actions/checkout`)
}
main()

View File

@@ -40,6 +40,10 @@ for json_file in $script_dir/../../config/actions/*.json; do
curl_download_commands+=("curl -s -S -L -o '$sha.zip' 'https://api.github.com/repos/$owner/$repo/zipball/$sha'")
done
# Get an array of ignoreTags patterns (if present)
ignore_patterns=()
IFS=$'\n' read -r -d '' -a ignore_patterns < <( echo "$json" | jq --raw-output '.ignoreTags // [] | .[]' && printf '\0' )
# Get an array of tag info. Each item contains "<tag> <commit_sha>"
tag_info=()
IFS=$'\n' read -r -d '' -a tag_info < <( echo "$json" | jq --raw-output '.tags | to_entries | .[] | .key + " " + .value.commit' && printf '\0' )
@@ -49,6 +53,20 @@ for json_file in $script_dir/../../config/actions/*.json; do
tag="${split[0]}"
sha="${split[1]}"
# Check if the tag matches any ignore pattern
skip_tag=false
for pattern in "${ignore_patterns[@]}"; do
if [[ "$tag" =~ $pattern ]]; then
echo "Ignoring tag '$tag' (matches pattern '$pattern')"
skip_tag=true
break
fi
done
if [ "$skip_tag" = true ]; then
continue
fi
# Append curl download command
curl_download_commands+=("curl -s -S -L -o '$sha.tar.gz' 'https://api.github.com/repos/$owner/$repo/tarball/$sha'")
curl_download_commands+=("curl -s -S -L -o '$sha.zip' 'https://api.github.com/repos/$owner/$repo/zipball/$sha'")

View File

@@ -22,8 +22,9 @@ async function main() {
const repo = config.repo
const patterns = config.patterns
const defaultBranch = config.defaultBranch
const ignoreTags = config.ignoreTags
assert.ok(patterns && patterns.length, 'Existing patterns must not be empty')
await actionConfig.add(owner, repo, patterns, defaultBranch)
await actionConfig.add(owner, repo, patterns, defaultBranch, ignoreTags)
}
}
catch (err) {