Skip to content

Commit e501475

Browse files
committed
Build/Test Tools: Skip pull_request triggered runs in private repos in 6.8.
This modifies the conditions for GitHub Actions workflow runs so that they do not run within private forks and mirrors for `pull_request` events when the PR is in `draft` status. For situations where this may be desirable, a `Draft Workflow Runs` label can be added to a `draft` pull request to force workflows to run. Reviewed by lancewillett. Merges r63183 to the 6.8 branch. Props desrosj, jorbin, lancewillett. See #65848. git-svn-id: https://develop.svn.wordpress.org/branches/6.8@65699 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 23c7842 commit e501475

11 files changed

Lines changed: 210 additions & 22 deletions

‎.github/workflows/coding-standards.yml‎

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,31 @@ jobs:
4848
uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-php.yml@trunk
4949
permissions:
5050
contents: read
51-
if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }}
51+
if: |
52+
github.repository == 'WordPress/wordpress-develop' || (
53+
github.event_name == 'pull_request' &&
54+
github.actor != 'dependabot[bot]' && (
55+
! github.event.repository.private ||
56+
! github.event.pull_request.draft ||
57+
contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
58+
)
59+
)
5260
5361
# Runs the JavaScript coding standards checks.
5462
jshint:
5563
name: JavaScript coding standards
5664
uses: WordPress/wordpress-develop/.github/workflows/reusable-coding-standards-javascript.yml@trunk
5765
permissions:
5866
contents: read
59-
if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }}
67+
if: |
68+
github.repository == 'WordPress/wordpress-develop' || (
69+
github.event_name == 'pull_request' &&
70+
github.actor != 'dependabot[bot]' && (
71+
! github.event.repository.private ||
72+
! github.event.pull_request.draft ||
73+
contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
74+
)
75+
)
6076
6177
slack-notifications:
6278
name: Slack Notifications

‎.github/workflows/end-to-end-tests.yml‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,15 @@ jobs:
5353
uses: WordPress/wordpress-develop/.github/workflows/reusable-end-to-end-tests.yml@trunk
5454
permissions:
5555
contents: read
56-
if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }}
56+
if: |
57+
github.repository == 'WordPress/wordpress-develop' || (
58+
github.event_name == 'pull_request' &&
59+
github.actor != 'dependabot[bot]' && (
60+
! github.event.repository.private ||
61+
! github.event.pull_request.draft ||
62+
contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
63+
)
64+
)
5765
strategy:
5866
fail-fast: false
5967
matrix:

‎.github/workflows/javascript-tests.yml‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,15 @@ jobs:
4949
uses: WordPress/wordpress-develop/.github/workflows/reusable-javascript-tests.yml@trunk
5050
permissions:
5151
contents: read
52-
if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }}
52+
if: |
53+
github.repository == 'WordPress/wordpress-develop' || (
54+
github.event_name == 'pull_request' &&
55+
github.actor != 'dependabot[bot]' && (
56+
! github.event.repository.private ||
57+
! github.event.pull_request.draft ||
58+
contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
59+
)
60+
)
5361
5462
slack-notifications:
5563
name: Slack Notifications

‎.github/workflows/local-docker-environment.yml‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,15 @@ jobs:
7373
permissions:
7474
contents: read
7575
secrets: inherit
76-
if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }}
76+
if: |
77+
github.repository == 'WordPress/wordpress-develop' || (
78+
github.event_name == 'pull_request' &&
79+
github.actor != 'dependabot[bot]' && (
80+
! github.event.repository.private ||
81+
! github.event.pull_request.draft ||
82+
contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
83+
)
84+
)
7785
with:
7886
wp-version: ${{ github.event_name == 'pull_request' && github.base_ref || github.ref_name }}
7987

‎.github/workflows/performance.yml‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,18 @@ jobs:
4646
determine-matrix:
4747
name: Determine Matrix
4848
runs-on: ubuntu-26.04
49-
if: ${{ ( github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) ) && ! contains( github.event.before, '00000000' ) }}
49+
if: |
50+
(
51+
github.repository == 'WordPress/wordpress-develop' || (
52+
github.event_name == 'pull_request' &&
53+
github.actor != 'dependabot[bot]' && (
54+
! github.event.repository.private ||
55+
! github.event.pull_request.draft ||
56+
contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
57+
)
58+
)
59+
) &&
60+
! contains( github.event.before, '00000000' )
5061
permissions:
5162
actions: read
5263
env:

‎.github/workflows/php-compatibility.yml‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,15 @@ jobs:
4242
uses: WordPress/wordpress-develop/.github/workflows/reusable-php-compatibility.yml@trunk
4343
permissions:
4444
contents: read
45-
if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }}
45+
if: |
46+
github.repository == 'WordPress/wordpress-develop' || (
47+
github.event_name == 'pull_request' &&
48+
github.actor != 'dependabot[bot]' && (
49+
! github.event.repository.private ||
50+
! github.event.pull_request.draft ||
51+
contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
52+
)
53+
)
4654
4755
slack-notifications:
4856
name: Slack Notifications

‎.github/workflows/phpunit-tests.yml‎

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,15 @@ jobs:
7575
permissions:
7676
contents: read
7777
secrets: inherit
78-
if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }}
78+
if: |
79+
github.repository == 'WordPress/wordpress-develop' || (
80+
github.event_name == 'pull_request' &&
81+
github.actor != 'dependabot[bot]' && (
82+
! github.event.repository.private ||
83+
! github.event.pull_request.draft ||
84+
contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
85+
)
86+
)
7987
strategy:
8088
fail-fast: false
8189
matrix:
@@ -161,7 +169,15 @@ jobs:
161169
permissions:
162170
contents: read
163171
secrets: inherit
164-
if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }}
172+
if: |
173+
github.repository == 'WordPress/wordpress-develop' || (
174+
github.event_name == 'pull_request' &&
175+
github.actor != 'dependabot[bot]' && (
176+
! github.event.repository.private ||
177+
! github.event.pull_request.draft ||
178+
contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
179+
)
180+
)
165181
strategy:
166182
fail-fast: false
167183
matrix:
@@ -233,7 +249,15 @@ jobs:
233249
permissions:
234250
contents: read
235251
secrets: inherit
236-
if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }}
252+
if: |
253+
github.repository == 'WordPress/wordpress-develop' || (
254+
github.event_name == 'pull_request' &&
255+
github.actor != 'dependabot[bot]' && (
256+
! github.event.repository.private ||
257+
! github.event.pull_request.draft ||
258+
contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
259+
)
260+
)
237261
strategy:
238262
fail-fast: false
239263
matrix:
@@ -289,7 +313,15 @@ jobs:
289313
permissions:
290314
contents: read
291315
secrets: inherit
292-
if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }}
316+
if: |
317+
github.repository == 'WordPress/wordpress-develop' || (
318+
github.event_name == 'pull_request' &&
319+
github.actor != 'dependabot[bot]' && (
320+
! github.event.repository.private ||
321+
! github.event.pull_request.draft ||
322+
contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
323+
)
324+
)
293325
strategy:
294326
fail-fast: false
295327
matrix:

‎.github/workflows/test-build-processes.yml‎

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,15 @@ jobs:
4848
uses: WordPress/wordpress-develop/.github/workflows/reusable-test-core-build-process.yml@trunk
4949
permissions:
5050
contents: read
51-
if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }}
51+
if: |
52+
github.repository == 'WordPress/wordpress-develop' || (
53+
github.event_name == 'pull_request' &&
54+
github.actor != 'dependabot[bot]' && (
55+
! github.event.repository.private ||
56+
! github.event.pull_request.draft ||
57+
contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
58+
)
59+
)
5260
strategy:
5361
fail-fast: false
5462
matrix:
@@ -100,7 +108,15 @@ jobs:
100108
uses: WordPress/wordpress-develop/.github/workflows/reusable-test-gutenberg-build-process.yml@trunk
101109
permissions:
102110
contents: read
103-
if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }}
111+
if: |
112+
github.repository == 'WordPress/wordpress-develop' || (
113+
github.event_name == 'pull_request' &&
114+
github.actor != 'dependabot[bot]' && (
115+
! github.event.repository.private ||
116+
! github.event.pull_request.draft ||
117+
contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
118+
)
119+
)
104120
strategy:
105121
fail-fast: false
106122
matrix:

‎.github/workflows/upgrade-develop-testing.yml‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,31 @@ jobs:
4444
build:
4545
name: Build
4646
uses: WordPress/wordpress-develop/.github/workflows/reusable-build-package.yml@trunk
47+
if: |
48+
github.repository == 'WordPress/wordpress-develop' || (
49+
github.event_name == 'pull_request' &&
50+
github.actor != 'dependabot[bot]' && (
51+
! github.event.repository.private ||
52+
! github.event.pull_request.draft ||
53+
contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
54+
)
55+
)
4756
permissions:
4857
contents: read
4958

5059
# Run upgrade tests for the current branch.
5160
upgrade-tests-develop:
5261
name: Upgrade from ${{ matrix.wp }}
5362
uses: WordPress/wordpress-develop/.github/workflows/reusable-upgrade-testing.yml@trunk
54-
if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }}
63+
if: |
64+
github.repository == 'WordPress/wordpress-develop' || (
65+
github.event_name == 'pull_request' &&
66+
github.actor != 'dependabot[bot]' && (
67+
! github.event.repository.private ||
68+
! github.event.pull_request.draft ||
69+
contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
70+
)
71+
)
5572
needs: [ build ]
5673
permissions:
5774
contents: read

‎.github/workflows/upgrade-testing.yml‎

Lines changed: 63 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,15 @@ jobs:
5858
upgrade-tests-last-two-releases:
5959
name: ${{ matrix.wp }} to ${{ inputs.new-version && inputs.new-version || 'latest' }}
6060
uses: WordPress/wordpress-develop/.github/workflows/reusable-upgrade-testing.yml@trunk
61-
if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }}
61+
if: |
62+
github.repository == 'WordPress/wordpress-develop' || (
63+
github.event_name == 'pull_request' &&
64+
github.actor != 'dependabot[bot]' && (
65+
! github.event.repository.private ||
66+
! github.event.pull_request.draft ||
67+
contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
68+
)
69+
)
6270
strategy:
6371
fail-fast: false
6472
matrix:
@@ -93,7 +101,15 @@ jobs:
93101
upgrade-tests-wp-6x-mysql:
94102
name: ${{ matrix.wp }} to ${{ inputs.new-version && inputs.new-version || 'latest' }}
95103
uses: WordPress/wordpress-develop/.github/workflows/reusable-upgrade-testing.yml@trunk
96-
if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }}
104+
if: |
105+
github.repository == 'WordPress/wordpress-develop' || (
106+
github.event_name == 'pull_request' &&
107+
github.actor != 'dependabot[bot]' && (
108+
! github.event.repository.private ||
109+
! github.event.pull_request.draft ||
110+
contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
111+
)
112+
)
97113
strategy:
98114
fail-fast: false
99115
matrix:
@@ -121,7 +137,15 @@ jobs:
121137
upgrade-tests-wp-5x-php-7x-mysql:
122138
name: ${{ matrix.wp }} to ${{ inputs.new-version && inputs.new-version || 'latest' }}
123139
uses: WordPress/wordpress-develop/.github/workflows/reusable-upgrade-testing.yml@trunk
124-
if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }}
140+
if: |
141+
github.repository == 'WordPress/wordpress-develop' || (
142+
github.event_name == 'pull_request' &&
143+
github.actor != 'dependabot[bot]' && (
144+
! github.event.repository.private ||
145+
! github.event.pull_request.draft ||
146+
contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
147+
)
148+
)
125149
strategy:
126150
fail-fast: false
127151
matrix:
@@ -153,7 +177,15 @@ jobs:
153177
upgrade-tests-wp-5x-php-8x-mysql:
154178
name: ${{ matrix.wp }} to ${{ inputs.new-version && inputs.new-version || 'latest' }}
155179
uses: WordPress/wordpress-develop/.github/workflows/reusable-upgrade-testing.yml@trunk
156-
if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }}
180+
if: |
181+
github.repository == 'WordPress/wordpress-develop' || (
182+
github.event_name == 'pull_request' &&
183+
github.actor != 'dependabot[bot]' && (
184+
! github.event.repository.private ||
185+
! github.event.pull_request.draft ||
186+
contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
187+
)
188+
)
157189
strategy:
158190
fail-fast: false
159191
matrix:
@@ -178,7 +210,15 @@ jobs:
178210
upgrade-tests-wp-4x-php-7x-mysql:
179211
name: ${{ matrix.wp }} to ${{ inputs.new-version && inputs.new-version || 'latest' }}
180212
uses: WordPress/wordpress-develop/.github/workflows/reusable-upgrade-testing.yml@trunk
181-
if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }}
213+
if: |
214+
github.repository == 'WordPress/wordpress-develop' || (
215+
github.event_name == 'pull_request' &&
216+
github.actor != 'dependabot[bot]' && (
217+
! github.event.repository.private ||
218+
! github.event.pull_request.draft ||
219+
contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
220+
)
221+
)
182222
strategy:
183223
fail-fast: false
184224
matrix:
@@ -212,7 +252,15 @@ jobs:
212252
upgrade-tests-wp-4x-php-8x-mysql:
213253
name: ${{ matrix.wp }} to ${{ inputs.new-version && inputs.new-version || 'latest' }}
214254
uses: WordPress/wordpress-develop/.github/workflows/reusable-upgrade-testing.yml@trunk
215-
if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }}
255+
if: |
256+
github.repository == 'WordPress/wordpress-develop' || (
257+
github.event_name == 'pull_request' &&
258+
github.actor != 'dependabot[bot]' && (
259+
! github.event.repository.private ||
260+
! github.event.pull_request.draft ||
261+
contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
262+
)
263+
)
216264
strategy:
217265
fail-fast: false
218266
matrix:
@@ -236,7 +284,15 @@ jobs:
236284
upgrade-tests-oldest-wp-mysql:
237285
name: ${{ matrix.wp }} to ${{ inputs.new-version && inputs.new-version || 'latest' }}
238286
uses: WordPress/wordpress-develop/.github/workflows/reusable-upgrade-testing.yml@trunk
239-
if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }}
287+
if: |
288+
github.repository == 'WordPress/wordpress-develop' || (
289+
github.event_name == 'pull_request' &&
290+
github.actor != 'dependabot[bot]' && (
291+
! github.event.repository.private ||
292+
! github.event.pull_request.draft ||
293+
contains( github.event.pull_request.labels.*.name, 'Draft Workflow Runs' )
294+
)
295+
)
240296
strategy:
241297
fail-fast: false
242298
matrix:

0 commit comments

Comments
 (0)