chore_: set $GIT_COMMIT for codeclimate (#5315)

When Jenkins creates a build, it can sometimes run the build on a detached HEAD, causing the commit SHA to be different from the SHA of your branch. This will cause issues when reporting test coverage to Code Climate.

Setting `GIT_COMMIT` fixes code climate upload errors.

ref -> https://docs.codeclimate.com/docs/jenkins#jenkins-ci-builds

Closes #5294
This commit is contained in:
Siddarth Kumar 2024-06-10 07:30:10 +05:30 committed by GitHub
parent c2f5bdb907
commit 8e53f62331
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -128,6 +128,8 @@ grep -h -v "^mode:" ./**/*.coverage.out >> c.out
rm -rf ./**/*.coverage.out
if [[ $UNIT_TEST_REPORT_CODECLIMATE == 'true' ]]; then
# https://docs.codeclimate.com/docs/jenkins#jenkins-ci-builds
GIT_COMMIT=$(git log | grep -m1 -oE '[^ ]+$')
cc-test-reporter after-build --prefix=github.com/status-im/status-go
fi