Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
This commit is contained in:
Jess Frazelle 2018-09-24 21:20:06 -04:00
parent eb47bdda03
commit 25e31e790c
No known key found for this signature in database
GPG Key ID: 18F3685C0022BFF3

View File

@ -15,6 +15,11 @@ if [[ -z "$GITHUB_REPOSITORY" ]]; then
exit 1
fi
if [[ -z "$GITHUB_REF" ]]; then
echo "Set the GITHUB_REF env variable."
exit 1
fi
URI=https://api.github.com
API_VERSION=v3
API_HEADER="Accept: application/vnd.github.${API_VERSION}+json"
@ -32,6 +37,8 @@ main(){
# Validate the GitHub token.
curl -o /dev/null -sSL -H "${AUTH_HEADER}" -H "${API_HEADER}" "${URI}/repos/${GITHUB_REPOSITORY}" || { echo "Error: Invalid repo, token or network issue!"; exit 1; }
echo "Github ref: ${GITHUB_REF}"
# Get the tags.
tag_response=$(curl -sSL -H "${AUTH_HEADER}" -H "${API_HEADER}" "${URI}/repos/${GITHUB_REPOSITORY}/tags")