Use Location: header for GitHub API call

Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
This commit is contained in:
Dan Schaper 2021-01-16 11:45:26 -08:00
parent 9bcd8e163a
commit 494667c85d
No known key found for this signature in database
GPG Key ID: B4FF14C01CC08DC0
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ MULTIARCH_IMAGE="${BASE_IMAGE}:${GIT_TAG}"
# To get latest released, cut a release on https://github.com/pi-hole/docker-pi-hole/releases (manually gated for quality control)
latest_tag='UNKNOWN'
if ! latest_tag=$(curl -sI https://github.com/pi-hole/docker-pi-hole/releases/latest | grep --color=never -i Location | awk -F / '{print $NF}' | tr -d '[:cntrl:]'); then
if ! latest_tag=$(curl -sI https://github.com/pi-hole/docker-pi-hole/releases/latest | grep --color=never -i Location: | awk -F / '{print $NF}' | tr -d '[:cntrl:]'); then
print "Failed to retrieve latest docker-pi-hole release metadata"
else
if [[ "${GIT_TAG}" == "${latest_tag}" ]] ; then