diff --git a/README.md b/README.md index 49c4932d..36f06696 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Usage: codacy-coverage-reporter report --coverage-reports | -r --partial --prefix - --skip-ssl-verification` [default: false] - Skip the SSL certificate verification when communicating with the Codacy API + --skip-ssl-verification [default: false] - Skip the SSL certificate verification when communicating with the Codacy API --force-coverage-parser Available parsers are: opencover,clover,lcov,phpunit,jacoco,dotcover,cobertura,go @@ -51,6 +51,12 @@ Usage: codacy-coverage-reporter report --> Succeeded! ``` +Codacy Coverage Reporter can be run with the `CODACY_REPORTER_OPTIONS` environment variable. This is useful for passing options to the reporter without having to modify the script. + +``` +CODACY_REPORTER_OPTIONS="--skip-ssl-verification true" +``` + ## What is Codacy? [Codacy](https://www.codacy.com/) is an Automated Code Review Tool that monitors your technical debt, helps you improve your code quality, teaches best practices to your developers, and helps you save time in Code Reviews. diff --git a/get.sh b/get.sh index d063c197..7ec39670 100755 --- a/get.sh +++ b/get.sh @@ -231,13 +231,22 @@ if [ -z "$run_command" ] then fatal "Codacy coverage reporter binary could not be found." fi +if [ -z "$CODACY_REPORTER_OPTIONS" ] || [ -n "$CODACY_REPORTER_OPTIONS" ]; then + EXTRA_ARGUMENTS="$CODACY_REPORTER_OPTIONS" +else + EXTRA_ARGUMENTS="" +fi + if [ "$#" -eq 1 ] && [ "$1" = "download" ]; then log "$g" "Codacy reporter download succeeded"; elif [ "$#" -gt 0 ]; then - eval "$run_command $*" + log "Running command: $run_command $* $EXTRA_ARGUMENTS" + eval "$run_command $* $EXTRA_ARGUMENTS" else - eval "$run_command \"report\"" + log "Running command: $run_command \"report\" $EXTRA_ARGUMENTS" + eval "$run_command \"report\" $EXTRA_ARGUMENTS" fi +