Skip to content
This repository was archived by the owner on Jan 12, 2025. It is now read-only.

Commit 5ebb486

Browse files
feat: gh-release now has releaseTagRegex argument support (#457)
1 parent 77e65d6 commit 5ebb486

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/gh-release/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Github Release feature will download, extract and add to path a release binary f
1919
| binaryNames | The target binary name (Comma separated in case there are multiple binaries in the same asset). For example, for Github CLI the binary name would be simply 'gh'. For DigitalOcean CLI: 'doctl'. For etcd it would be two: 'etcd,etcdctl' | string | - |
2020
| version | Select the version of the github release binary to install. | string | latest |
2121
| assetRegex | An optional filtering regex to help point the correct release asset. | string | - |
22+
| releaseTagRegex | An optional filtering regex to help point the correct release git tag. | string | - |
2223
| binLocation | Location to download the target binary to. Typically a location which exist under PATH variable | string | /usr/local/bin |
2324
| libName | Name for the lib dir (if exists). Will default to binary name if not given | string | - |
2425
| libLocation | Any lib files (if exists) will be downloaded into this location. The binary will then be soft linked from the lib location to the bin location | string | /usr/local/lib |

src/gh-release/devcontainer-feature.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "gh-release",
3-
"version": "1.0.18",
3+
"version": "1.0.19",
44
"name": "Github Release",
55
"documentationURL": "http://github.com/devcontainers-contrib/features/tree/main/src/gh-release",
66
"description": "Github Release feature will download, extract and add to path a release binary from a given repo",
@@ -38,6 +38,11 @@
3838
"description": "An optional filtering regex to help point the correct release asset.",
3939
"type": "string"
4040
},
41+
"releaseTagRegex": {
42+
"default": "",
43+
"description": "An optional filtering regex to help point the correct release git tag.",
44+
"type": "string"
45+
},
4146
"binLocation": {
4247
"default": "/usr/local/bin",
4348
"description": "Location to download the target binary to. Typically a location which exist under PATH variable",

src/gh-release/install.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ ensure_nanolayer nanolayer_location "v0.4.45"
1414

1515

1616

17+
release_tag_regex=$(if ! [[ -z $RELEASETAGREGEX ]]; then echo --release-tag-regex "${RELEASETAGREGEX}" ; fi)
1718
asset_regex_cmd=$(if ! [[ -z $ASSETREGEX ]]; then echo --asset-regex "${ASSETREGEX}" ; fi)
1819
lib_name_cmd=$(if ! [[ -z $LIBNAME ]]; then echo --lib-name "${LIBNAME}" ; fi)
1920
$nanolayer_location \
2021
install gh-release \
2122
"$REPO" \
2223
"$BINARYNAMES" --force \
23-
--version "$VERSION" --bin-location "$BINLOCATION" --lib-location "$LIBLOCATION" $asset_regex_cmd $lib_name_cmd
24+
--version "$VERSION" --bin-location "$BINLOCATION" --lib-location "$LIBLOCATION" $asset_regex_cmd $lib_name_cmd $release_tag_regex
2425

0 commit comments

Comments
 (0)