@@ -37,13 +37,31 @@ jobs:
3737 - name : Identify any Maven Build changes
3838 run : >
3939 ! (git status | grep "modified: " )
40- - name : Upload coverage reports to Codecov
40+
41+ # -------- Codecov coverage upload --------
42+ # Fork PRs: upload WITHOUT token
43+ - name : Upload coverage reports to Codecov (fork PRs, no token)
44+ if : ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork }}
4145 uses : codecov/codecov-action@v5
42- env :
46+
47+ # Pushes & same-repo PRs: upload WITH token
48+ - name : Upload coverage reports to Codecov (internal only)
49+ if : ${{ github.event_name != 'pull_request' || (github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork) }}
50+ uses : codecov/codecov-action@v5
51+ with :
4352 slug : awslabs/aws-athena-query-federation
44- CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
45- - name : Upload test results to Codecov
46- if : ${{ !cancelled() }}
53+ token : ${{ secrets.CODECOV_TOKEN }}
54+ # -------- Codecov test results --------
55+ # Fork PRs: no token
56+ - name : Upload test results to Codecov (fork PRs, no token)
57+ if : ${{ !cancelled() && github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork }}
58+ uses : codecov/test-results-action@v1
59+ with :
60+ slug : awslabs/aws-athena-query-federation
61+
62+ # Pushes & same-repo PRs: with token
63+ - name : Upload test results to Codecov (internal only)
64+ if : ${{ !cancelled() && (github.event_name != 'pull_request' || (github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork)) }}
4765 uses : codecov/test-results-action@v1
4866 with :
4967 slug : awslabs/aws-athena-query-federation
0 commit comments