Skip to content

Commit 303b083

Browse files
authored
Merge branch 'main' into dependabot/bundler/selenium-webdriver-4.35.0
2 parents 6488dd0 + aaea780 commit 303b083

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

.github/workflows/rubyonrails.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,22 @@ jobs:
8989
bundle exec rspec
9090
continue-on-error: ${{ matrix.allowed_failure }}
9191

92+
- name: Generate coverage badge
93+
if: ${{ github.ref == 'refs/heads/main' && success() }}
94+
continue-on-error: true
95+
run: |
96+
COVERAGE=$(jq -r '.result.covered_percent' coverage/.last_run.json)
97+
COLOR=$(node -e "cov=parseFloat(process.argv[1]);console.log(cov>=90?'green':cov>=75?'orange':'red')" $COVERAGE)
98+
npx badgen-cli coverage ${COVERAGE}% -c $COLOR > coverage.svg
99+
100+
- name: Commit badge
101+
if: ${{ github.ref == 'refs/heads/main' && success() }}
102+
continue-on-error: true
103+
uses: stefanzweifel/git-auto-commit-action@v5
104+
with:
105+
commit_message: "chore: update coverage badge"
106+
file_pattern: coverage.svg
107+
92108
# ── style & security jobs (unchanged) ───────────────────────────────────────
93109
rubocop:
94110
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)