File tree 1 file changed +15
-3
lines changed
1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ name: UploadCoverageReport
8
8
- master
9
9
pull_request :
10
10
11
+ env :
12
+ REPORT_PATH : " coverage/coverage-final.json"
13
+
11
14
jobs :
12
15
UploadCoverageReport :
13
16
runs-on : ubuntu-latest
25
28
- name : Generate coverage report
26
29
run : npm test -- --coverage
27
30
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
30
41
with :
31
- files : " coverage/coverage-final.json"
42
+ token : ${{ secrets.CODECOV_TOKEN }}
43
+ files : " ${{ env.REPORT_PATH }}"
32
44
fail_ci_if_error : true
33
45
...
You can’t perform that action at this time.
0 commit comments