Skip to content

Commit d6ba09d

Browse files
committed
pull_request_target should allow PR jobs to use secrets, enabling codecov uplaods
1 parent 4f5365d commit d6ba09d

1 file changed

Lines changed: 3 additions & 14 deletions

File tree

.github/workflows/ci-test.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Test
22

33
on:
4-
pull_request:
4+
pull_request_target:
55
branches: [master]
66
push:
77
branches: [master]
@@ -144,25 +144,14 @@ jobs:
144144
if: matrix.backend == 'redis'
145145
run: pytest -m redis --cov=cachier --cov-report=term --cov-report=xml:cov.xml
146146

147-
- name: Upload coverage to Codecov (non-PRs)
148-
if: github.event_name != 'pull_request' # pushes, scheduled, etc.
147+
- name: Upload coverage to Codecov
149148
continue-on-error: true
150149
uses: codecov/codecov-action@v5
151150
with:
152151
fail_ci_if_error: true
153152
token: ${{ secrets.CODECOV_TOKEN }} # required
154153
flags: ${{ matrix.backend }}
155-
156-
# We need a separate step for PRs because PRs do not have access to
157-
# secrets; hence, provide the token will give it an empty value,
158-
# resulting in an authentication error.
159-
- name: Upload coverage to Codecov (PRs)
160-
if: github.event_name == 'pull_request' # PRs only
161-
continue-on-error: true
162-
uses: codecov/codecov-action@v5
163-
with:
164-
fail_ci_if_error: true
165-
flags: ${{ matrix.backend }}
154+
override_pr: ${{ github.event.pull_request.number }}
166155

167156
testing-guardian:
168157
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)