1010 description : Apify API token for a secondary test user, used in multi-user scenarios (e.g. sharing restricted storage).
1111 required : false
1212 CODECOV_TOKEN :
13- required : true
13+ required : false
1414 description : Token for uploading coverage reports to Codecov.
1515 inputs :
1616 python-versions :
4141 name : Integration tests
4242
4343 # Run this only for PRs from the main repository or for pushes to master. Skip otherwise.
44- if : github.event.pull_request.head.repo.owner.login == 'apify' || github.ref == 'refs/heads/master'
44+ if : >-
45+ ${{
46+ (github.event_name == 'pull_request' && github.event.pull_request.head.repo.owner.login == 'apify') ||
47+ (github.event_name == 'push' && github.ref == 'refs/heads/master')
48+ }}
4549
4650 strategy :
4751 matrix :
5155
5256 runs-on : ${{ matrix.os }}
5357
58+ env :
59+ CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
60+
5461 steps :
5562 - name : Checkout repository
5663 uses : actions/checkout@v6
@@ -74,11 +81,17 @@ jobs:
7481 APIFY_TEST_USER_API_TOKEN : ${{ secrets.APIFY_TEST_USER_PYTHON_SDK_API_TOKEN }}
7582 APIFY_TEST_USER_2_API_TOKEN : ${{ secrets.APIFY_TEST_USER_2_API_TOKEN }}
7683
77- # Upload coverage only for the latest Python to avoid redundant uploads.
84+ # Upload coverage only for the ubuntu-latest and latest Python, and only when the Codecov token
85+ # is available (e.g. not for fork PRs).
7886 - name : Upload integration test coverage
79- if : ${{ matrix.os == inputs.operating-system-for-codecov && matrix.python-version == inputs.python-version-for-codecov }}
87+ if : >-
88+ ${{
89+ matrix.os == inputs.operating-system-for-codecov &&
90+ matrix.python-version == inputs.python-version-for-codecov &&
91+ env.CODECOV_TOKEN != ''
92+ }}
8093 uses : codecov/codecov-action@v5
8194 with :
82- token : ${{ secrets .CODECOV_TOKEN }}
95+ token : ${{ env .CODECOV_TOKEN }}
8396 files : coverage-integration.xml
8497 flags : integration
0 commit comments