mirror of
https://github.com/jessfraz/dockerfiles.git
synced 2025-12-09 22:42:40 +01:00
@@ -15,6 +15,11 @@ if [[ -z "$GITHUB_REPOSITORY" ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$GITHUB_REF" ]]; then
|
||||||
|
echo "Set the GITHUB_REF env variable."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
URI=https://api.github.com
|
URI=https://api.github.com
|
||||||
API_VERSION=v3
|
API_VERSION=v3
|
||||||
API_HEADER="Accept: application/vnd.github.${API_VERSION}+json"
|
API_HEADER="Accept: application/vnd.github.${API_VERSION}+json"
|
||||||
@@ -32,6 +37,8 @@ main(){
|
|||||||
# Validate the GitHub token.
|
# 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; }
|
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.
|
# Get the tags.
|
||||||
tag_response=$(curl -sSL -H "${AUTH_HEADER}" -H "${API_HEADER}" "${URI}/repos/${GITHUB_REPOSITORY}/tags")
|
tag_response=$(curl -sSL -H "${AUTH_HEADER}" -H "${API_HEADER}" "${URI}/repos/${GITHUB_REPOSITORY}/tags")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user