From fe49be220a85a113108b91a6da22861bcc0e4a86 Mon Sep 17 00:00:00 2001 From: cicdguy <26552821+cicdguy@users.noreply.github.com> Date: Tue, 13 Feb 2024 09:42:57 -0600 Subject: [PATCH 1/2] fix: Normalize the option to post coverage as PR comment --- .github/workflows/test-coverage.yaml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 106f5b9c..8060604b 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -158,10 +158,16 @@ jobs: echo "ref-name=${{ steps.branch-name.outputs.current_branch }}" >> $GITHUB_OUTPUT fi # Check if pkgdown multiversion docs are used at all. + echo "multiversion-docs=false" >> $GITHUB_OUTPUT if [ $(grep -rl '' gh-pages | wc -l) -gt 0 ]; then echo "multiversion-docs=true" >> $GITHUB_OUTPUT - else - echo "multiversion-docs=false" >> $GITHUB_OUTPUT + fi + # Normalize the 'publish-coverage-report' option + echo "publish-coverage-report=${{ inputs.publish-coverage-report }}" >> $GITHUB_OUTPUT + if [ "${{ inputs.publish-coverage-report }}" == "" ] + then { + echo "publish-coverage-report=true" >> $GITHUB_OUTPUT + } fi shell: bash @@ -271,7 +277,7 @@ jobs: path: ${{ github.event.repository.name }}/${{ inputs.package-subdirectory }}/coverage.xml threshold: 80 fail: false - publish: ${{ inputs.publish-coverage-report }} + publish: ${{ steps.current-branch-or-tag.outputs.publish-coverage-report }} diff: true continue-on-error: true From 1db4a456b45f0aaf3fc857ea0746ca47f11c2f18 Mon Sep 17 00:00:00 2001 From: cicdguy <26552821+cicdguy@users.noreply.github.com> Date: Tue, 13 Feb 2024 09:54:42 -0600 Subject: [PATCH 2/2] fix: Separate out the normalizer --- .github/workflows/test-coverage.yaml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 8060604b..e97d0995 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -158,16 +158,10 @@ jobs: echo "ref-name=${{ steps.branch-name.outputs.current_branch }}" >> $GITHUB_OUTPUT fi # Check if pkgdown multiversion docs are used at all. - echo "multiversion-docs=false" >> $GITHUB_OUTPUT if [ $(grep -rl '' gh-pages | wc -l) -gt 0 ]; then echo "multiversion-docs=true" >> $GITHUB_OUTPUT - fi - # Normalize the 'publish-coverage-report' option - echo "publish-coverage-report=${{ inputs.publish-coverage-report }}" >> $GITHUB_OUTPUT - if [ "${{ inputs.publish-coverage-report }}" == "" ] - then { - echo "publish-coverage-report=true" >> $GITHUB_OUTPUT - } + else + echo "multiversion-docs=false" >> $GITHUB_OUTPUT fi shell: bash @@ -186,6 +180,17 @@ jobs: ref: ${{ steps.branch-name.outputs.head_ref_branch }} path: ${{ github.event.repository.name }} + - name: Normalize inputs ⊳ + id: normalizer + shell: bash + run: | + echo "publish-coverage-report=${{ inputs.publish-coverage-report }}" >> $GITHUB_OUTPUT + if [ "${{ inputs.publish-coverage-report }}" == "" ] + then { + echo "publish-coverage-report=true" >> $GITHUB_OUTPUT + } + fi + - name: Restore SD cache 💰 uses: actions/cache@v4 with: @@ -277,7 +282,7 @@ jobs: path: ${{ github.event.repository.name }}/${{ inputs.package-subdirectory }}/coverage.xml threshold: 80 fail: false - publish: ${{ steps.current-branch-or-tag.outputs.publish-coverage-report }} + publish: ${{ steps.normalizer.outputs.publish-coverage-report }} diff: true continue-on-error: true