From bfb39d5d6bf9c09ae8c1e61f57e27376894b730f Mon Sep 17 00:00:00 2001 From: Christopher Byrd Date: Tue, 2 Apr 2024 14:25:43 -0700 Subject: [PATCH] nit --- .github/workflows/main.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d92ea3f..f5fc11e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -65,7 +65,6 @@ jobs: run: | git fetch origin main:main baseline_coverage=$(git show main:coverage.json | grep -o '"totals": {[^}]*' | grep -o '"percent_covered": [0-9.]*' | awk -F ': ' '{print $2}') - echo "BARBARBAR $baseline_coverage" echo "$baseline_coverage" > .coverage_baseline - name: Compare coverage with baseline @@ -73,8 +72,13 @@ jobs: current_coverage=$(coverage report -m | grep TOTAL | awk '{print int($4)}' | sed 's/%//') baseline_coverage=$(cat .coverage_baseline) baseline_coverage=$(printf "%.0f" "$baseline_coverage") - echo "FOOFOOFOO from $baseline_coverage% to $current_coverage%" if [[ "$current_coverage" -lt "$baseline_coverage" ]]; then echo "Coverage decreased from $baseline_coverage% to $current_coverage%" exit 1 + else + echo "Coverage didn't decrease. Committing new coverage.json." + coverage json + git add coverage.json + git commit -m "Update coverage.json" + git push origin ${{ github.head_ref }} fi