Skip to content

Commit 295ac4b

Browse files
authored
Update codecov/codecov-action to v4 (#5100)
1 parent ab094ef commit 295ac4b

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

.github/workflows/build.yml

+14-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: Build
22
on: [push, pull_request]
33

4-
env:
5-
COVERAGE_REPORT_PATH: "target/site/jacoco/jacoco.xml"
6-
74
jobs:
85
build:
96
runs-on: ubuntu-latest
@@ -16,8 +13,19 @@ jobs:
1613
distribution: 'adopt'
1714
- name: Build with Maven
1815
run: mvn --batch-mode --update-snapshots verify
19-
- name: Upload coverage to codecov
20-
uses: codecov/codecov-action@v3
16+
- name: Upload coverage to codecov (tokenless)
17+
if: >-
18+
github.event_name == 'pull_request' &&
19+
github.event.pull_request.head.repo.full_name != github.repository
20+
uses: codecov/codecov-action@v4
21+
with:
22+
fail_ci_if_error: true
23+
- name: Upload coverage to codecov (with token)
24+
if: >
25+
github.repository == 'TheAlgorithms/Java' &&
26+
(github.event_name != 'pull_request' ||
27+
github.event.pull_request.head.repo.full_name == github.repository)
28+
uses: codecov/codecov-action@v4
2129
with:
22-
files: "${{ env.REPORT_NAME }}"
30+
token: ${{ secrets.CODECOV_TOKEN }}
2331
fail_ci_if_error: true

0 commit comments

Comments
 (0)