I think this is so the ::endgroup:: can be printed to close the group, but because we're running with -e, the script will exit as soon as the first command fails.
The way to capture exit codes under set -e is like:
if ! cmd
then
exit_code=$?
fi
cleanup
exit $exit_code
In my opinion, this isn't a bug and doesn't need a fix. It's just code that doesn't do anything and might confuse or mislead future maintainers into thinking it serves a purpose.
I see in the new composite action, we try to capture the exit code from running & reporting the Brakeman findings:
https://github.com/reviewdog/action-brakeman/blob/3073c89bf52f7e1a5ab4ba2d5bfc88815311c131/script.sh#L49
I think this is so the
::endgroup::
can be printed to close the group, but because we're running with-e
, the script will exit as soon as the first command fails.The way to capture exit codes under
set -e
is like:or using
trap
s