Skip to content

Commit

Permalink
For #457. Cleaner main branch coverage badge
Browse files Browse the repository at this point in the history
  • Loading branch information
binkley committed Aug 9, 2024
1 parent 36f2f0a commit bcf928c
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions .github/workflows/ci-earthly-maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ jobs:
# CSV JaCoCo report.

- name: Generate coverage badge
# if: ${{ github.ref == 'refs/head/master' }}
uses: cicirello/jacoco-badge-generator@v2
with:
badges-directory: images
Expand All @@ -120,24 +119,14 @@ jobs:

# The saved badge does not appear when you pull code locally
- name: Add coverage to CI repo
# if: ${{ github.ref == 'refs/head/master' }}
# Limit frontpage badge to mainline code, not branches or PRs
if: ${{ github.ref == 'refs/head/master' }}
run: |
cd images
if [[ ! -z "$(git status --porcelain *.svg)" ]]; then
git config --global user.name 'github-actions'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add *.svg
git commit -m 'Autogenerated coverage badge'
git push || echo "$0: Another build won for coverage badge" >&2
fi
- name: Add coverage to repo
# if: ${{ github.ref == 'refs/head/master' }}
run: |
cd images
if [[ ! -z "$(git status --porcelain *.svg)" ]]; then
git config --global user.name 'github-actions'
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git add *.svg
git commit -m 'Autogenerated coverage badge'
git push || echo "$0: Another build won for coverage badge" >&2
git push
fi

0 comments on commit bcf928c

Please sign in to comment.