diff --git a/.github/workflows/server-ci-template.yml b/.github/workflows/server-ci-template.yml index 18feb06c3d..8fcac9f770 100644 --- a/.github/workflows/server-ci-template.yml +++ b/.github/workflows/server-ci-template.yml @@ -265,6 +265,8 @@ jobs: drivername: mysql logsartifact: mysql-server-test-logs test-coverage: + # Skip coverage generation for cherry-pick PRs into release branches. + if: ${{ github.event_name != 'pull_request' || !startsWith(github.event.pull_request.base.ref, 'release-') }} name: Generate Test Coverage needs: check-mattermost-vet uses: ./.github/workflows/server-test-template.yml diff --git a/.github/workflows/server-test-template.yml b/.github/workflows/server-test-template.yml index eeecc3d85d..ac6d747cbe 100644 --- a/.github/workflows/server-test-template.yml +++ b/.github/workflows/server-test-template.yml @@ -78,6 +78,7 @@ jobs: $BUILD_IMAGE \ make test-server$RACE_MODE BUILD_NUMBER=$GITHUB_HEAD_REF-$GITHUB_RUN_ID - name: Upload coverage to Codecov + if: ${{ inputs.enablecoverage }} uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/webapp-ci-template.yml b/.github/workflows/webapp-ci-template.yml index ddf03a5d76..02f63d31bb 100644 --- a/.github/workflows/webapp-ci-template.yml +++ b/.github/workflows/webapp-ci-template.yml @@ -79,6 +79,8 @@ jobs: run: | npm run test-ci - name: Upload coverage to Codecov + # Skip coverage upload for cherry-pick PRs into release branches. + if: ${{ github.event_name != 'pull_request' || !startsWith(github.event.pull_request.base.ref, 'release-') }} uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }}