Skip to content

Commit 6026f0a

Browse files
committed
fix(ci): Guard Codecov upload when token is unavailable
1 parent c49d83a commit 6026f0a

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

.github/workflows/tests.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
name: PHPUnit (PHP ${{ matrix.php }})
2020
runs-on: ubuntu-latest
2121
continue-on-error: ${{ matrix.php == '8.5' }}
22+
env:
23+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2224
strategy:
2325
fail-fast: false
2426
matrix:
@@ -54,16 +56,16 @@ jobs:
5456
run: composer test:unit
5557

5658
- name: Upload coverage to Codecov
57-
if: ${{ matrix.php == '8.1' && secrets.CODECOV_TOKEN != '' }}
59+
if: ${{ matrix.php == '8.1' && env.CODECOV_TOKEN != '' }}
5860
uses: codecov/codecov-action@v5
5961
with:
6062
files: build/coverage.xml
6163
disable_search: true
6264
fail_ci_if_error: true
63-
token: ${{ secrets.CODECOV_TOKEN }}
65+
token: ${{ env.CODECOV_TOKEN }}
6466

6567
- name: Skip Codecov upload (missing CODECOV_TOKEN)
66-
if: ${{ matrix.php == '8.1' && secrets.CODECOV_TOKEN == '' }}
68+
if: ${{ matrix.php == '8.1' && env.CODECOV_TOKEN == '' }}
6769
run: echo "Codecov upload skipped because CODECOV_TOKEN is not configured for this workflow context."
6870

6971
integration-live:

0 commit comments

Comments
 (0)