Quantcast
Channel: Active questions tagged jq - Stack Overflow
Viewing all articles
Browse latest Browse all 657

jq array filter works locally, but not in a GitHub workflow

$
0
0

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 error

If I run the same command with jq locally, it works - why doesn't it work on a GitHub runner?


Viewing all articles
Browse latest Browse all 657

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>