Skip to content

Commit c84d466

Browse files
committed
GH Actions/quicktest: fix failing build when contributors update their fork
The `quicktest` workflow runs the code coverage for merges to `develop`, but wasn't limited to this repo. The net effect of this is failing builds for contributors who have actions enabled on their fork and who update the `develop` branch in their own fork. The reason for the failure is that they don't have access to the `CODECOV_TOKEN`. This commit changes the conditions on when to run the tests normally and when to run with code coverage to take the organisation where the repo lives into account. That should prevent the failing builds.
1 parent 227baf6 commit c84d466

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/quicktest.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ jobs:
6464
run: composer lint
6565

6666
- name: Run the unit tests without code coverage
67-
if: ${{ github.ref_name != 'develop' }}
67+
if: ${{ github.repository_owner != 'WordPress' || github.ref_name != 'develop' }}
6868
run: composer run-tests
6969

7070
- name: Run the unit tests with code coverage
71-
if: ${{ github.ref_name == 'develop' }}
71+
if: ${{ github.repository_owner == 'WordPress' && github.ref_name == 'develop' }}
7272
run: composer coverage
7373

7474
- name: Send coverage report to Codecov
75-
if: ${{ success() && github.ref_name == 'develop' }}
75+
if: ${{ success() && github.repository_owner == 'WordPress' && github.ref_name == 'develop' }}
7676
uses: codecov/codecov-action@v5
7777
with:
7878
files: ./build/logs/clover.xml

0 commit comments

Comments
 (0)