Because git commits exit with non-zero code when there are no changes to be committed, this causes the github action to fail. To overcome that I try to check if there are any changes before committing like the following -
if git diff-index --quiet HEAD --; then
echo "changes_exist=true" >> $GITHUB_ENV
else
echo "changes_exist=false" >> $GITHUB_ENV
fi
GitHub then shows this to me below it -
shell: /bin/bash -e {0}
Googling this does not seem to yield anything. Any idea what that means?
Exact output of the runner -
Run if git diff-index --quiet HEAD --; then
if git diff-index --quiet HEAD --; then
echo "changes_exist=true" >> $GITHUB_ENV
else
echo "changes_exist=false" >> $GITHUB_ENV
fi
shell: /bin/bash -e {0}
env:
pythonLocation: /opt/hostedtoolcache/Python/3.9.1/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.1/x64/lib