diff --git a/.circleci/config.yml b/.circleci/config.yml
index e62a1146c1ed3baff11e925d8382a6df6628cb62..81bc16fcd1df3d6d427fc355fc848a2086807d7e 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -290,7 +290,7 @@ _steps:
       working_directory: /opt/overlay_ws
       command: |
         curl -s https://codecov.io/bash > codecov
-        local codecov_version=$(grep -o 'VERSION=\"[0-9\.]*\"' codecov | cut -d'"' -f2)
+        codecov_version=$(grep -o 'VERSION=\"[0-9\.]*\"' codecov | cut -d'"' -f2)
         shasum -a 512 -c <(curl -s "https://raw.githubusercontent.com/codecov/codecov-bash/${codecov_version}/SHA512SUM" | grep -w "codecov")
         bash codecov \
           -f "lcov/project_coverage.info" \
diff --git a/tools/code_coverage_report.bash b/tools/code_coverage_report.bash
index fe27717b0b0ca312234d3345d481b74c673493f1..e836a3ed94408343d9735fc2b57e97818928cb27 100755
--- a/tools/code_coverage_report.bash
+++ b/tools/code_coverage_report.bash
@@ -88,7 +88,7 @@ lcov \
 
 if [ $COVERAGE_REPORT_VIEW = codecovio ]; then
   curl -s https://codecov.io/bash > codecov
-  local codecov_version=$(grep -o 'VERSION=\"[0-9\.]*\"' codecov | cut -d'"' -f2)
+  codecov_version=$(grep -o 'VERSION=\"[0-9\.]*\"' codecov | cut -d'"' -f2)
   shasum -a 512 -c <(curl -s "https://raw.githubusercontent.com/codecov/codecov-bash/${codecov_version}/SHA512SUM" | grep -w "codecov")
   bash codecov \
     -f ${LCOVDIR}/project_coverage.info \