Skip to content

Commit 9010481

Browse files
authored
chore: update codecov-action to v4 (TheAlgorithms#1605)
The token has been added to the repository secrets.
1 parent 8ceaa25 commit 9010481

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

Diff for: .github/workflows/UploadCoverageReport.yml

+15-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ name: UploadCoverageReport
88
- master
99
pull_request:
1010

11+
env:
12+
REPORT_PATH: "coverage/coverage-final.json"
13+
1114
jobs:
1215
UploadCoverageReport:
1316
runs-on: ubuntu-latest
@@ -25,9 +28,18 @@ jobs:
2528
- name: Generate coverage report
2629
run: npm test -- --coverage
2730

28-
- name: Upload coverage to codecov
29-
uses: codecov/codecov-action@v3
31+
- name: Upload coverage to codecov (tokenless)
32+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
33+
uses: codecov/codecov-action@v4
34+
with:
35+
files: "${{ env.REPORT_PATH }}"
36+
fail_ci_if_error: true
37+
38+
- name: Upload coverage to codecov (with token)
39+
if: "! github.event.pull_request.head.repo.fork "
40+
uses: codecov/codecov-action@v4
3041
with:
31-
files: "coverage/coverage-final.json"
42+
token: ${{ secrets.CODECOV_TOKEN }}
43+
files: "${{ env.REPORT_PATH }}"
3244
fail_ci_if_error: true
3345
...

0 commit comments

Comments
 (0)