Skip to content

Commit 2f93657

Browse files
RohanBob
andcommitted
fix: improve codecov upload token handling and add guard condition
- Add condition to only run on main repo when token is available - Move CODECOV_TOKEN from env to with.token parameter (preferred by codecov-action v5) - Prevents issues with fork PRs where secrets are unavailable Addresses Copilot feedback validated by @edeandrea in PR docling-project#406 Co-authored-by: Bob <bob@codeium.com> Signed-off-by: Rohan <rohan.kurian@ibm.com>
1 parent 47405bb commit 2f93657

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,14 @@ jobs:
108108
run: ./gradlew --no-daemon -Pjava.version=${{ matrix.java }} :test-report-aggregation:check
109109

110110
- name: Upload coverage to Codecov
111+
if: ${{ github.repository == 'docling-project/docling-java' && secrets.CODECOV_TOKEN != '' }}
111112
uses: codecov/codecov-action@1af58845a975a7985b0beb0cbe6fbbb71a41dbad # v5.5.3
112113
with:
113114
files: ./test-report-aggregation/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml
114115
flags: java${{ matrix.java }}
115116
name: codecov-java${{ matrix.java }}
116117
fail_ci_if_error: false
117-
env:
118-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
118+
token: ${{ secrets.CODECOV_TOKEN }}
119119

120120
- name: Prepare build reports
121121
if: always()

0 commit comments

Comments
 (0)