Skip to content

Commit bcf928c

Browse files
committed
For #457. Cleaner main branch coverage badge
1 parent 36f2f0a commit bcf928c

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

.github/workflows/ci-earthly-maven.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ jobs:
111111
# CSV JaCoCo report.
112112

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

121120
# The saved badge does not appear when you pull code locally
122121
- name: Add coverage to CI repo
123-
# if: ${{ github.ref == 'refs/head/master' }}
122+
# Limit frontpage badge to mainline code, not branches or PRs
123+
if: ${{ github.ref == 'refs/head/master' }}
124124
run: |
125125
cd images
126126
if [[ ! -z "$(git status --porcelain *.svg)" ]]; then
127127
git config --global user.name 'github-actions'
128128
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
129129
git add *.svg
130130
git commit -m 'Autogenerated coverage badge'
131-
git push || echo "$0: Another build won for coverage badge" >&2
132-
fi
133-
- name: Add coverage to repo
134-
# if: ${{ github.ref == 'refs/head/master' }}
135-
run: |
136-
cd images
137-
if [[ ! -z "$(git status --porcelain *.svg)" ]]; then
138-
git config --global user.name 'github-actions'
139-
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
140-
git add *.svg
141-
git commit -m 'Autogenerated coverage badge'
142-
git push || echo "$0: Another build won for coverage badge" >&2
131+
git push
143132
fi

0 commit comments

Comments
 (0)