Skip to content

Commit a610134

Browse files
authored
Store tag name from GitHub API response
Store the tag name in a variable for later use.
1 parent 1d84537 commit a610134

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

release_files/install.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ if [ -z ${NETBIRD_RELEASE+x} ]; then
2929
NETBIRD_RELEASE=latest
3030
fi
3131

32+
TAG_NAME=""
33+
3234
get_release() {
3335
local RELEASE=$1
3436
if [ "$RELEASE" = "latest" ]; then
@@ -39,16 +41,16 @@ get_release() {
3941
local URL="https://api.github.com/repos/${OWNER}/${REPO}/releases/${TAG}"
4042
fi
4143
if [ -n "$GITHUB_TOKEN" ]; then
42-
curl -H "Authorization: token ${GITHUB_TOKEN}" -s "${URL}" \
43-
| grep '"tag_name":' | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+'
44+
TAG_NAME=$(curl -H "Authorization: token ${GITHUB_TOKEN}" -s "${URL}" | grep '"tag_name":')
4445
else
45-
curl -s "${URL}" \
46-
| grep '"tag_name":' | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+'
46+
TAG_NAME=$(curl -s "${URL}" | grep '"tag_name":')
4747
fi
48+
echo "${TAG_NAME}" | grep -oE 'v[0-9]+\.[0-9]+\.[0-9]+'
4849
}
4950

5051
download_release_binary() {
5152
VERSION=$(get_release "$NETBIRD_RELEASE")
53+
echo "Using the following tag name for binary installation: ${TAG_NAME}"
5254
BASE_URL="https://github.com/${OWNER}/${REPO}/releases/download"
5355
BINARY_BASE_NAME="${VERSION#v}_${OS_TYPE}_${ARCH}.tar.gz"
5456

0 commit comments

Comments
 (0)