From bcf928c778df6ad708a6681ff00b5b8976da893c Mon Sep 17 00:00:00 2001 From: "B. K. Oxley (binkley)" Date: Fri, 9 Aug 2024 08:56:58 -0500 Subject: [PATCH] For #457. Cleaner main branch coverage badge --- .github/workflows/ci-earthly-maven.yml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci-earthly-maven.yml b/.github/workflows/ci-earthly-maven.yml index 07a7cf45..f18952af 100644 --- a/.github/workflows/ci-earthly-maven.yml +++ b/.github/workflows/ci-earthly-maven.yml @@ -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 @@ -120,7 +119,8 @@ 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 @@ -128,16 +128,5 @@ jobs: 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