File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed
Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change 11name : CI
22
3- on : [push, pull_request]
3+ on :
4+ push :
5+ branches : [main, master]
6+ pull_request :
7+ branches : [main, master]
48
59jobs :
610 python :
11+ # Prevent duplicate runs on PRs from the same repository
12+ if : github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
713 runs-on : ${{ matrix.os }}
814 strategy :
915 matrix :
@@ -57,14 +63,25 @@ jobs:
5763 run : poetry run pytest tests
5864
5965 - name : Upload coverage reports
60- if : matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
66+ # Only upload coverage if we have a token (skip for Dependabot PRs)
67+ if : matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' && (github.event_name != 'pull_request' || github.actor != 'dependabot[bot]')
6168 uses : codecov/codecov-action@v4
6269 with :
6370 token : ${{ secrets.CODECOV_TOKEN }}
6471 files : ./coverage.xml
6572 flags : unittests
6673 name : python-sdk
67- fail_ci_if_error : true
74+ fail_ci_if_error : false
75+
76+ - name : Upload coverage reports (tokenless)
77+ # Use tokenless upload for Dependabot PRs
78+ if : matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' && github.event_name == 'pull_request' && github.actor == 'dependabot[bot]'
79+ uses : codecov/codecov-action@v4
80+ with :
81+ files : ./coverage.xml
82+ flags : unittests
83+ name : python-sdk
84+ fail_ci_if_error : false
6885
6986 - name : Upload coverage artifacts
7087 if : matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'
You can’t perform that action at this time.
0 commit comments