I'm using jq to extract an array from a JSON in a GitHub workflow:
name: Teston: workflow_dispatch:jobs: test: runs-on: ubuntu-latest steps: - name: Test run: echo $(echo '{"value":[{"displayName":"test"}]}' | jq -c '.value.[]')However, it fails with the error
Run echo $(echo '{"value":[{"displayName":"test"}]}' | jq -c '.value.[]')jq: error: syntax error, unexpected '[', expecting FORMAT or QQSTRING_START (Unix shell quoting issues?) at <top-level>, line 1:.value.[] jq: 1 compile errorIf I run the same command with jq locally, it works - why doesn't it work on a GitHub runner?