Skip to content

Commit

Permalink
ci-release: try to use curl to download artifacts
Browse files Browse the repository at this point in the history
https://github.com/website-local/mdn-local/actions/runs/8129229384/job/22216054601
Resolving productionresultssa14.blob.core.windows.net (productionresultssa14.blob.core.windows.net)... 20.209.74.225, 20.209.52.65, 20.209.75.97
Connecting to productionresultssa14.blob.core.windows.net (productionresultssa14.blob.core.windows.net)|20.209.74.225|:443... connected.
HTTP request sent, awaiting response... 400 Authentication information is not given in the correct format. Check the value of Authorization header.
2024-03-03 09:27:31 ERROR 400: Authentication information is not given in the correct format. Check the value of Authorization header..
  • Loading branch information
myfreeer authored Mar 3, 2024
1 parent 8742bb8 commit 451639f
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,21 @@ jobs:
mkdir -p download
pushd download
for url in $archive_download_urls; do
wget --header="Authorization: Bearer ${{ secrets.GH_ACTION_TOKEN }}" "$url"
auth_header="Authorization: Bearer ${{ secrets.GH_ACTION_TOKEN }}"
# Make the initial request with the Authorization header and capture the headers
response_headers=$(curl -s -I -L --header "$auth_header" "$url")
# Look for a Location header in case of a redirect
redirect_url=$(echo "$response_headers" | grep -i Location: | tail -n1 | sed -e 's/Location: //I' | tr -d '\r')
# Check if a redirect URL was found
if [ -n "$redirect_url" ]; then
echo "Redirect URL found: $redirect_url"
# Make a new request to the redirect URL without the Authorization header
curl -L "$redirect_url" -O
else
echo "No redirect URL found, downloading directly."
# If no redirect was found, download the file directly with the Authorization header
curl -L --header "$auth_header" "$url" -O
fi
done
mkdir -p ../release
for zip_file in $(ls); do
Expand Down

0 comments on commit 451639f

Please sign in to comment.