Ensure git clean state after running license_finder
What does this MR do and why?
Ensure git clean state after running license_finder
Our script for validating licenses does not restore
a clean git state because the whole script scripts/license-check.sh
is marked as set -e
which means if any command fails with a non-zero
exit code the script terminates its execution. The failing scenario
is:
- We start
license-check.sh
script which modifiesGemfile.lock
due to a workaround described inside the script. - Then we run
license_finder
gem. - If it exits with a non-zero status code then
the next command
git checkout -q
will never execute.
The simplest solution to resolve that failing scenario is
to capture the exit code of license_finder
gem, store it,
restore the git clean state and exit with this exit code.
Please see this CI job for an example.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Vitaly Slobodin