I have the following in my Github Actions YAML. It runs fine when the first check evaluates true,
- name: Check version is up to date
run: sh -c "
(git diff --quiet HEAD^ VERSION && git diff --quiet HEAD^ src/**) || \
! git diff --quiet HEAD^ src/VERSION
"
but when it evaluates false, the later sections gives me
sh: 1: !: not found
only in GitHub Actions. The command starting (and including) sh -c doesn't error on my computer. I don't understand how that could be since I very explicitly mention the shell.
!bash? And if so, why does it work on my machine even withsh -c?