max*_*ann 6 curl github-actions
对于我的一项 CI 工作,我需要使用 http get 请求从 api 检索一些数据。由于 api 需要身份验证,我将 api 密钥添加到 github secrets 中并尝试使用 curl 获取数据。虽然这在本地工作正常,但当我尝试在 github 操作中执行此操作时出现以下错误:
curl: (92) HTTP/2 stream 1 was not closed cleanly: PROTOCOL_ERROR (err 1)
Run Code Online (Sandbox Code Playgroud)
我在操作中使用以下请求:
apiResults=$(curl --location 'https://api.rebrandly.com/v1/links' --header 'Content-Type: application/json' --header "apikey: ${{ secrets.apikey }}")
Run Code Online (Sandbox Code Playgroud)
卷曲版本
curl 7.58.0 (x86_64-pc-linux-gnu) libcurl/7.58.0 OpenSSL/1.1.1d zlib/1.2.11 libidn2/2.0.4 libpsl/0.19.1 (+libidn2/2.0.4) nghttp2/1.30.0 librtmp/2.3
Run Code Online (Sandbox Code Playgroud)
详细输出
2019-12-30T18:32:38.6563004Z % Total % Received % Xferd Average Speed Time Time Time Current
2019-12-30T18:32:38.6564270Z Dload Upload Total Spent Left Speed
2019-12-30T18:32:38.6564751Z
2019-12-30T18:32:38.7812244Z 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Trying 99.84.44.58...
2019-12-30T18:32:38.7813156Z * TCP_NODELAY set
2019-12-30T18:32:38.7921480Z * Connected to api.rebrandly.com (99.84.44.58) port 443 (#0)
2019-12-30T18:32:38.7922609Z * ALPN, offering h2
2019-12-30T18:32:38.7923485Z * ALPN, offering http/1.1
2019-12-30T18:32:38.7988090Z * successfully set certificate verify locations:
2019-12-30T18:32:38.7990153Z * CAfile: /etc/ssl/certs/ca-certificates.crt
2019-12-30T18:32:38.7990969Z CApath: /etc/ssl/certs
2019-12-30T18:32:38.7991681Z } [5 bytes data]
2019-12-30T18:32:38.7992355Z * TLSv1.3 (OUT), TLS handshake, Client hello (1):
2019-12-30T18:32:38.7993427Z } [512 bytes data]
2019-12-30T18:32:38.8146675Z * TLSv1.3 (IN), TLS handshake, Server hello (2):
2019-12-30T18:32:38.8147192Z { [70 bytes data]
2019-12-30T18:32:38.8147663Z * TLSv1.2 (IN), TLS handshake, Certificate (11):
2019-12-30T18:32:38.8148123Z { [5159 bytes data]
2019-12-30T18:32:38.8151320Z * TLSv1.2 (IN), TLS handshake, Server key exchange (12):
2019-12-30T18:32:38.8152265Z { [333 bytes data]
2019-12-30T18:32:38.8152979Z * TLSv1.2 (IN), TLS handshake, Server finished (14):
2019-12-30T18:32:38.8153638Z { [4 bytes data]
2019-12-30T18:32:38.8154933Z * TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
2019-12-30T18:32:38.8155436Z } [70 bytes data]
2019-12-30T18:32:38.8155886Z * TLSv1.2 (OUT), TLS change cipher, Client hello (1):
2019-12-30T18:32:38.8156372Z } [1 bytes data]
2019-12-30T18:32:38.8156816Z * TLSv1.2 (OUT), TLS handshake, Finished (20):
2019-12-30T18:32:38.8157442Z } [16 bytes data]
2019-12-30T18:32:38.8260604Z * TLSv1.2 (IN), TLS handshake, Finished (20):
2019-12-30T18:32:38.8261223Z { [16 bytes data]
2019-12-30T18:32:38.8262302Z * SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
2019-12-30T18:32:38.8262910Z * ALPN, server accepted to use h2
2019-12-30T18:32:38.8263789Z * Server certificate:
2019-12-30T18:32:38.8264625Z * subject: OU=Domain Control Validated; CN=*.rebrandly.com
2019-12-30T18:32:38.8265435Z * start date: May 7 15:56:14 2019 GMT
2019-12-30T18:32:38.8265894Z * expire date: Jul 6 15:25:39 2021 GMT
2019-12-30T18:32:38.8266925Z * subjectAltName: host "api.rebrandly.com" matched cert's "*.rebrandly.com"
2019-12-30T18:32:38.8267992Z * issuer: C=US; ST=Arizona; L=Scottsdale; O=GoDaddy.com, Inc.; OU=http://certs.godaddy.com/repository/; CN=Go Daddy Secure Certificate Authority - G2
2019-12-30T18:32:38.8269332Z * SSL certificate verify ok.
2019-12-30T18:32:38.8270481Z * Using HTTP2, server supports multi-use
2019-12-30T18:32:38.8271070Z * Connection state changed (HTTP/2 confirmed)
2019-12-30T18:32:38.8271681Z * Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
2019-12-30T18:32:38.8272348Z } [5 bytes data]
2019-12-30T18:32:38.8272880Z * Using Stream ID: 1 (easy handle 0x5568c8b4c6b0)
2019-12-30T18:32:38.8273583Z } [5 bytes data]
2019-12-30T18:32:38.8274006Z > GET /v1/links HTTP/2
2019-12-30T18:32:38.8274428Z > Host: api.rebrandly.com
2019-12-30T18:32:38.8275204Z > User-Agent: curl/7.58.0
2019-12-30T18:32:38.8275665Z > Accept: */*
2019-12-30T18:32:38.8276286Z > Content-Type: application/json
2019-12-30T18:32:38.8276820Z > apikey: ***
2019-12-30T18:32:38.8277236Z >
2019-12-30T18:32:38.8277646Z >
2019-12-30T18:32:38.8278045Z { [5 bytes data]
2019-12-30T18:32:38.8278495Z * Connection state changed (MAX_CONCURRENT_STREAMS updated)!
2019-12-30T18:32:38.8279167Z } [5 bytes data]
2019-12-30T18:32:38.8372807Z * HTTP/2 stream 1 was not closed cleanly: PROTOCOL_ERROR (err 1)
2019-12-30T18:32:38.8373469Z
2019-12-30T18:32:38.8374620Z 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
2019-12-30T18:32:38.8375228Z * Connection #0 to host api.rebrandly.com left intact
2019-12-30T18:32:38.8375882Z curl: (92) HTTP/2 stream 1 was not closed cleanly: PROTOCOL_ERROR (err 1)
Run Code Online (Sandbox Code Playgroud)