Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
This commit is contained in:
Jess Frazelle 2018-09-24 20:08:27 -04:00
parent 7cd5ad3f9a
commit c1ba5f5041
No known key found for this signature in database
GPG Key ID: 18F3685C0022BFF3

View File

@ -1,7 +1,5 @@
#!/bin/bash #!/bin/bash
# This script gets the latest GitHub releases for the specified projects. # This script gets the latest GitHub releases for the specified projects.
set -e
set -o pipefail
if [[ -z "$GITHUB_TOKEN" ]]; then if [[ -z "$GITHUB_TOKEN" ]]; then
echo "Set the GITHUB_TOKEN env variable." echo "Set the GITHUB_TOKEN env variable."
@ -19,9 +17,9 @@ get_latest() {
local resp local resp
resp=$(curl -sSL -H "${AUTH_HEADER}" -H "${API_HEADER}" "${URI}/repos/${repo}/releases") resp=$(curl -sSL -H "${AUTH_HEADER}" -H "${API_HEADER}" "${URI}/repos/${repo}/releases")
local tag local tag
tag=$(echo "$resp" | jq -e --raw-output .[0].tag_name || echo "null") tag=$(echo "$resp" | jq -e --raw-output .[0].tag_name)
local name local name
name=$(echo "$resp" | jq -e --raw-output .[0].name || echo "null") name=$(echo "$resp" | jq -e --raw-output .[0].name)
if [[ "$tag" == "null" ]]; then if [[ "$tag" == "null" ]]; then
# get the latest tag # get the latest tag