I have following fragment in my github action:
steps:
- uses: actions/checkout@v2
- run: grep resolved package-lock.json | grep -q example.com && echo "package-lock.json contains invalid entries" && exit 1
shell: bash --noprofile --norc {0}
name: Validate package-lock.json file
But it fails, first I thought it was issue with pipefail so I provide now my own template above, but I still get error:
Run grep resolved package-lock.json | grep -q example.com && echo "package-lock.json contains invalid entries" && exit 1
grep resolved package-lock.json | grep -q example.com && echo "package-lock.json contains invalid entries" && exit 1
shell: /usr/bin/bash --noprofile --norc {0}
Error: Process completed with exit code 1.
I validated that this one-liner works fine when I execute it in my bash, so why it doesn't when on github action?