Hi, hoping you could help with below issue. Following jq query works fine with jq however, getting an issue with the resource.
- name: golang-http-jq-release
type: http-jq-resource
source:
base_url: https://go.dev/dl/?mode=json
jq_filter: '.[] | recurse(.files[]?) | select( .os == "linux" and .arch =="amd64") | select(.version|startswith("go1.17")).filename'
--2022-04-20 16:47:32-- https://go.dev/dl/?mode=json
Resolving go.dev... 216.239.36.21, 216.239.32.21, 216.239.34.21, ...
Connecting to go.dev|216.239.36.21|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9703 (9.5K) [application/json]
Saving to: '/tmp/echo-response'
0K ......... 100% 2.88M=0.003s
2022-04-20 16:47:32 (2.88 MB/s) - '/tmp/echo-response' saved [9703/9703]
parse error: Invalid numeric literal at line 2, column 0
❯ curl -s 'https://go.dev/dl/?mode=json' | jq '.[] | recurse(.files[]?) | select( .os == "linux" and .arch =="amd64") | select(.version|startswith("go1.17")).filename'
"go1.17.9.linux-amd64.tar.gz"