dev: fix installation script for curl v8.8.0 (#4814)
This commit is contained in:
parent
53eadf2406
commit
bff93a148a
10
.github/workflows/post-release.yml
vendored
10
.github/workflows/post-release.yml
vendored
@ -103,3 +103,13 @@ jobs:
|
||||
branch-suffix: timestamp
|
||||
title: "docs: update documentation assets"
|
||||
delete-branch: true
|
||||
|
||||
check-install-script:
|
||||
name: Installation script (remote)
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "./install-golangci-lint"
|
||||
|
11
.github/workflows/pr.yml
vendored
11
.github/workflows/pr.yml
vendored
@ -128,6 +128,17 @@ jobs:
|
||||
# needed for github-action-config.json generation
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
check-local-install-script:
|
||||
name: Installation script (local)
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Check installation script
|
||||
run: cat ./install.sh | sh -s -- -d -b "./install-golangci-lint"
|
||||
|
||||
# Note: the command `run` is tested by the previous steps (`make test`).
|
||||
commands:
|
||||
needs: golangci-lint
|
||||
|
20
install.sh
20
install.sh
@ -275,6 +275,26 @@ http_download_curl() {
|
||||
local_file=$1
|
||||
source_url=$2
|
||||
header=$3
|
||||
|
||||
# workaround https://github.com/curl/curl/issues/13845
|
||||
curl_version=$(curl --version | head -n 1 | awk '{ print $2 }')
|
||||
if [ "$curl_version" = "8.8.0" ]; then
|
||||
log_debug "http_download_curl curl $curl_version detected"
|
||||
if [ -z "$header" ]; then
|
||||
curl -sL -o "$local_file" "$source_url"
|
||||
else
|
||||
curl -sL -H "$header" -o "$local_file" "$source_url"
|
||||
|
||||
nf=$(cat "$local_file" | jq -r '.error // ""')
|
||||
if [ ! -z "$nf" ]; then
|
||||
log_debug "http_download_curl received an error: $nf"
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ -z "$header" ]; then
|
||||
code=$(curl -w '%{http_code}' -sL -o "$local_file" "$source_url")
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user