Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix ci linter scripts #1223

Merged
merged 1 commit into from
Jan 29, 2024
Merged

ci: fix ci linter scripts #1223

merged 1 commit into from
Jan 29, 2024

Commits on Jan 29, 2024

  1. ci: fix ci linter scripts

    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]>
    tuminoid committed Jan 29, 2024
    Configuration menu
    Copy the full SHA
    f2771a5 View commit details
    Browse the repository at this point in the history