Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Linting scripts were failing to Git safe dirertory check, both when run via GH actions, or locally via docker-compose. To fix the scripts, few things need to be changed. 1. Add /usr/src/app to Git safe directories, so Git will run any Git commands, such as "git fetch ..." in that directory. 2. Add "set -e" so command failure will fail the script, to produce correct return code for the check. 3. Due "set -e", and the loop we are running, we need to ignore the linting command returning failure, and capture the failure to be returned later command. 4. We also need to remove the grep from the pipeline. If the commit has no matching files, it would return false error, thanks to "-o pipefail". Same can be applied to all scripts, having Git filter the wanted files, instead of having additional if clause. Git safe directory check was introduced already in Git 2.35.2 in 2022, and the "ubuntu-latest" image used by the GH action shouldn't have taken too long to upgrade to that or newer Git version. The old GH action logs only go back a month, and they're all showing the same. It could be that the actions have been broken for 1.5 years. The same can bereproduced locally, as the node:18 image used by the docker-compose is also having recent enough Git. Signed-off-by: Tuomo Tanskanen <[email protected]>
- Loading branch information