Skip to content

Commit 76eeb61

Browse files
authored
Merge pull request #2653 from WordPress/feature/ghactions-improve-dont-run-on-forks
2 parents 3ef3f9d + 1f16cb6 commit 76eeb61

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

.github/workflows/manage-labels.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
jobs:
1313
on-pr-merge:
1414
runs-on: ubuntu-latest
15-
if: github.repository_owner == 'WordPress' && github.event.pull_request.merged == true
15+
if: github.event.repository.fork == false && github.event.pull_request.merged == true
1616

1717
name: Clean up labels on PR merge
1818

@@ -26,7 +26,7 @@ jobs:
2626
2727
on-pr-close:
2828
runs-on: ubuntu-latest
29-
if: github.repository_owner == 'WordPress' && github.event_name == 'pull_request_target' && github.event.pull_request.merged == false
29+
if: github.event.repository.fork == false && github.event_name == 'pull_request_target' && github.event.pull_request.merged == false
3030

3131
name: Clean up labels on PR close
3232

@@ -41,7 +41,7 @@ jobs:
4141
4242
on-issue-close:
4343
runs-on: ubuntu-latest
44-
if: github.repository_owner == 'WordPress' && github.event.issue.state == 'closed'
44+
if: github.event.repository.fork == false && github.event.issue.state == 'closed'
4545

4646
name: Clean up labels on issue close
4747

.github/workflows/quicktest.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@ jobs:
6666
run: composer lint
6767

6868
- name: Run the unit tests without code coverage
69-
if: ${{ github.repository_owner != 'WordPress' || github.ref_name != 'develop' }}
69+
if: ${{ github.event.repository.fork == true || github.ref_name != 'develop' }}
7070
run: composer run-tests
7171

7272
- name: Run the unit tests with code coverage
73-
if: ${{ github.repository_owner == 'WordPress' && github.ref_name == 'develop' }}
73+
if: ${{ github.event.repository.fork == false && github.ref_name == 'develop' }}
7474
run: composer coverage
7575

7676
- name: Send coverage report to Codecov
77-
if: ${{ success() && github.repository_owner == 'WordPress' && github.ref_name == 'develop' }}
77+
if: ${{ success() && github.event.repository.fork == false && github.ref_name == 'develop' }}
7878
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
7979
with:
8080
files: ./build/logs/clover.xml

.github/workflows/unit-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,15 @@ jobs:
128128
run: composer lint -- --checkstyle | cs2pr
129129

130130
- name: Run the unit tests without code coverage
131-
if: ${{ matrix.coverage == false || github.repository_owner != 'WordPress' }}
131+
if: ${{ matrix.coverage == false || github.event.repository.fork == true }}
132132
run: composer run-tests
133133

134134
- name: Run the unit tests with code coverage
135-
if: ${{ matrix.coverage == true && github.repository_owner == 'WordPress' }}
135+
if: ${{ matrix.coverage == true && github.event.repository.fork == false }}
136136
run: composer coverage
137137

138138
- name: Send coverage report to Codecov
139-
if: ${{ success() && matrix.coverage == true && github.repository_owner == 'WordPress' }}
139+
if: ${{ success() && matrix.coverage == true && github.event.repository.fork == false }}
140140
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
141141
with:
142142
files: ./build/logs/clover.xml

0 commit comments

Comments
 (0)