File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments