Skip to content

Commit fa0fe85

Browse files
committed
Merge branch 'trunk' into patch/63135
2 parents 2ffe432 + 9063e30 commit fa0fe85

File tree

183 files changed

+9941
-9063
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

183 files changed

+9941
-9063
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "WordPress Core Development",
44
"dockerComposeFile": "docker-compose.yml",
55
"service": "app",
6-
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
6+
"workspaceFolder": "/workspace",
77

88
// Features to add to the dev container. More info: https://containers.dev/features.
99
"features": {

.devcontainer/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ services:
1212
WORDPRESS_DB_PASSWORD: examplepass
1313
WORDPRESS_DB_NAME: exampledb
1414
volumes:
15-
- ../..:/workspaces:cached
15+
- ..:/workspace:cached
1616

1717
db:
1818
image: mariadb

.devcontainer/setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ else
99
fi
1010

1111
# Install dependencies
12-
cd /workspaces/wordpress-develop
12+
cd /workspace
1313
npm install && npm run build:dev
1414

1515
# Install WordPress and activate the plugin/theme.

.git-blame-ignore-revs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,14 @@ f4f1b4821342fd1d58708356b3ec39d6fefe31ac # [33411]
4848

4949
# Coding Standards
5050
8f95800d52c1736d651ae6e259f90ad4a0db2c3f # [42343]
51+
52+
# 6.8 Coding Standards
53+
a4d6fb7c96cb46859e6d48a5d4c06fdeea7d039b # [59292]
54+
9dd87b8f91300917447c271968d3c36289b440e8 # [59558]
55+
# 903b1fe840d4232bbc249d32d8981824e5fa71de # [59953] includes a punctuation change
56+
a96fa164b00ed51c7c0481574834cff92ab9b1f0 # [60043]
57+
7607cbc5d1e770451f1a2b61d851820dfa23bb43 # [60044]
58+
7047a91c0ecdbf43d4a7a0a591464cd1ed2f2c4b # [60046]
59+
1aa6da693ad739b78752a55d154cd48cb757b90b # [60047]
60+
d44e1c2ce2dc638e89ed6a1d02b1cfadb8a15fe7 # [60048]
61+
a18719e7ea49ab7ac0091e076840cb7efdf51cc5 # [60049]

.github/dependabot.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,101 @@ updates:
2929
composer-packages:
3030
patterns:
3131
- "composer/ca-bundle"
32+
33+
# Monitor some npm dependencies for updates in groups.
34+
- package-ecosystem: "npm"
35+
directory: "/"
36+
schedule:
37+
interval: "daily"
38+
open-pull-requests-limit: 20
39+
ignore:
40+
- dependency-name: "@wordpress/*"
41+
groups:
42+
##
43+
# Groups for updating devDependencies.
44+
##
45+
46+
# Dependencies related to Playwright testing (E2E, performance).
47+
tests-playwright:
48+
patterns:
49+
- "*playwright*"
50+
# Dependencies related to JavaScript testing with QUnit.
51+
tests-qunit:
52+
patterns:
53+
- "*qunit*"
54+
- "sinon*"
55+
# Dependencies related to CSS and SASS building and manilupating.
56+
dev-css-sass:
57+
patterns:
58+
- "autoprefixer"
59+
# postcss and css related dependencies.
60+
- "*css*"
61+
- "*sass"
62+
# Dependencies related to the Webpack build process.
63+
dev-webpack:
64+
patterns:
65+
- "*webpack*"
66+
- "react-refresh"
67+
- "source-map-loader"
68+
# Dependencies related to the local Docker development environment.
69+
dev-docker:
70+
patterns:
71+
- "dotenv*"
72+
- "wait-on"
73+
# Dependencies that do not fall into a specific grouping.
74+
dev-miscellaneous:
75+
patterns:
76+
- "chalk"
77+
- "check-node-version"
78+
- "ink-docstrap"
79+
- "install-changed"
80+
- "matchdep"
81+
- "uuid"
82+
# Dependencies related to JavaScript minification.
83+
dev-uglify:
84+
patterns:
85+
- "*uglify*"
86+
# All GruntJS related dependencies that do not relate to another group.
87+
dev-grunt:
88+
patterns:
89+
- "*grunt*"
90+
91+
##
92+
# Groups for updating production dependencies.
93+
##
94+
95+
# Dependencies related to jQuery and its ecosystem.
96+
external-jquery:
97+
patterns:
98+
- "jquery*"
99+
# Dependencies related to React and its ecosystem.
100+
external-react:
101+
patterns:
102+
- "react*"
103+
- "!react-refresh"
104+
# Dependencies used for bundling polyfill libraries into WordPress.
105+
external-polyfills:
106+
patterns:
107+
- "core-js-url-browser"
108+
- "element-closest"
109+
- "formdata-polyfill"
110+
- "imagesloaded"
111+
- "objectFitPolyfill"
112+
- "polyfill-library"
113+
- "regenerator-runtime"
114+
- "whatwg-fetch"
115+
- "wicg-inert"
116+
# Dependencies related to the Masonry library.
117+
external-masonry:
118+
patterns:
119+
- "masonry-layout"
120+
# Dependencies that do not fall into a specific grouping.
121+
external-miscellaneous:
122+
patterns:
123+
- "backbone"
124+
- "clipboard"
125+
- "hoverintent"
126+
- "json2php"
127+
- "lodash"
128+
- "moment"
129+
- "underscore"

.github/workflows/check-built-files.yml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Checks for uncommitted changes to built files and pushes changes back.
2-
name: Check built files
1+
# Checks for uncommitted changes to built files in pull requests.
2+
name: Check Built Files (PRs)
33

44
on:
55
# Because all commits happen through SVN and should always be manually reviewed by a committer, this workflow only
66
# runs for pull requests.
77
#
8-
# Other workflows that run on push will detect changes to versioned files and fail.
9-
pull_request_target:
8+
# Other workflows that run for the push event will detect changes to versioned files and fail.
9+
pull_request:
1010
branches:
1111
- trunk
1212
- '6.[8-9]'
@@ -31,21 +31,16 @@ on:
3131
concurrency:
3232
# The concurrency group contains the workflow name and the branch name for pull requests
3333
# or the commit hash for any other events.
34-
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.sha }}
34+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
3535
cancel-in-progress: true
3636

3737
# Disable permissions for all available scopes by default.
3838
# Any needed permissions should be configured at the job level.
3939
permissions: {}
4040

4141
jobs:
42-
update-built-files:
43-
name: Update built files
44-
permissions:
45-
contents: write
46-
if: ${{ github.repository == 'WordPress/wordpress-develop' }}
47-
# This should always reference a version of the workflow committed through SVN and never a local reference.
48-
uses: WordPress/wordpress-develop/.github/workflows/reusable-check-built-files.yml@trunk
49-
secrets:
50-
GH_APP_ID: ${{ secrets.GH_PR_MANAGEMENT_APP_ID }}
51-
GH_APP_PRIVATE_KEY: ${{ secrets.GH_PR_MANAGEMENT_APP_PRIVATE_KEY }}
42+
check-for-built-file-changes:
43+
name: Check built files
44+
# This prevents an unnecessary second run after changes are committed back because Dependabot always rebases and force pushes.
45+
if: ${{ github.repository == 'wordpress/wordpress-develop' && ( github.actor != 'dependabot[bot]' || github.event.commits < 2 ) }}
46+
uses: ./.github/workflows/reusable-check-built-files.yml

.github/workflows/coding-standards.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,15 @@ jobs:
5252
uses: ./.github/workflows/reusable-coding-standards-php.yml
5353
permissions:
5454
contents: read
55-
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
55+
if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }}
5656

5757
# Runs the JavaScript coding standards checks.
5858
jshint:
5959
name: JavaScript coding standards
6060
uses: ./.github/workflows/reusable-coding-standards-javascript.yml
6161
permissions:
6262
contents: read
63-
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
63+
if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }}
6464

6565
slack-notifications:
6666
name: Slack Notifications
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
# Commits all missed changes to built files back to pull request branches.
2+
name: Commit Built File Changes (PRs)
3+
4+
on:
5+
workflow_run:
6+
workflows: [ 'Check Built Files (PRs)' ]
7+
types:
8+
- completed
9+
10+
# Cancels all previous workflow runs for pull requests that have not completed.
11+
concurrency:
12+
# The concurrency group contains the workflow name and the branch name for pull requests
13+
# or the commit hash for any other events.
14+
group: ${{ github.workflow }}-${{ github.event_name == 'workflow_run' && format( '{0}-{1}', github.event.workflow_run.head_branch, github.event.workflow_run.head_repository.name ) || github.sha }}
15+
16+
# Disable permissions for all available scopes by default.
17+
# Any needed permissions should be configured at the job level.
18+
permissions: {}
19+
20+
jobs:
21+
# Checks a PR for uncommitted changes to built files.
22+
#
23+
# Performs the following steps:
24+
# - Attempts to download the artifact containing the PR diff.
25+
# - Checks for the existence of an artifact.
26+
# - Unzips the artifact.
27+
# - Generates a token for authenticating with the GitHub App.
28+
# - Checks out the repository.
29+
# - Applies the patch file.
30+
# - Displays the result of git diff.
31+
# - Configures the Git author.
32+
# - Stages changes.
33+
# - Commits changes.
34+
# - Pushes changes.
35+
update-built-files:
36+
name: Check and update built files
37+
runs-on: ubuntu-24.04
38+
if: ${{ github.repository == 'wordpress/wordpress-develop' }}
39+
timeout-minutes: 10
40+
permissions:
41+
contents: write
42+
steps:
43+
- name: Download artifact
44+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
45+
with:
46+
script: |
47+
const artifacts = await github.rest.actions.listWorkflowRunArtifacts( {
48+
owner: context.repo.owner,
49+
repo: context.repo.repo,
50+
run_id: process.env.RUN_ID,
51+
} );
52+
53+
const matchArtifact = artifacts.data.artifacts.filter( ( artifact ) => {
54+
return artifact.name === 'pr-built-file-changes'
55+
} )[0];
56+
57+
if ( ! matchArtifact ) {
58+
core.info( 'No artifact found!' );
59+
return;
60+
}
61+
62+
const download = await github.rest.actions.downloadArtifact( {
63+
owner: context.repo.owner,
64+
repo: context.repo.repo,
65+
artifact_id: matchArtifact.id,
66+
archive_format: 'zip',
67+
} );
68+
69+
const fs = require( 'fs' );
70+
fs.writeFileSync( '${{ github.workspace }}/pr-built-file-changes.zip', Buffer.from( download.data ) )
71+
env:
72+
RUN_ID: ${{ github.event.workflow_run.id }}
73+
74+
- name: Check for artifact
75+
id: artifact-check
76+
run: |
77+
if [ -f "pr-built-file-changes.zip" ]; then
78+
echo "exists=true" >> "$GITHUB_OUTPUT"
79+
else
80+
echo "exists=false" >> "$GITHUB_OUTPUT"
81+
fi
82+
83+
- name: Unzip the artifact containing the PR data
84+
if: ${{ steps.artifact-check.outputs.exists == 'true' }}
85+
run: unzip pr-built-file-changes.zip
86+
87+
- name: Generate Installation Token
88+
id: generate_token
89+
if: ${{ steps.artifact-check.outputs.exists == 'true' }}
90+
env:
91+
GH_APP_ID: ${{ secrets.GH_PR_BUILT_FILES_APP_ID }}
92+
GH_APP_PRIVATE_KEY: ${{ secrets.GH_PR_BUILT_FILES_PRIVATE_KEY }}
93+
run: |
94+
echo "$GH_APP_PRIVATE_KEY" > private-key.pem
95+
96+
# Generate JWT
97+
JWT=$(python3 - <<EOF
98+
import jwt, time
99+
private_key = open("private-key.pem", "r").read()
100+
payload = {
101+
"iat": int(time.time()),
102+
"exp": int(time.time()) + 600, # 10-minute expiration
103+
"iss": $GH_APP_ID
104+
}
105+
print(jwt.encode(payload, private_key, algorithm="RS256"))
106+
EOF
107+
)
108+
109+
# Get Installation ID
110+
INSTALLATION_ID=$(curl -s -X GET -H "Authorization: Bearer $JWT" \
111+
-H "Accept: application/vnd.github.v3+json" \
112+
https://api.github.com/app/installations | jq -r '.[0].id')
113+
114+
# Request Installation Access Token
115+
ACCESS_TOKEN=$(curl -s -X POST -H "Authorization: Bearer $JWT" \
116+
-H "Accept: application/vnd.github.v3+json" \
117+
"https://api.github.com/app/installations/$INSTALLATION_ID/access_tokens" | jq -r '.token')
118+
119+
echo "ACCESS_TOKEN=$ACCESS_TOKEN" >> "$GITHUB_ENV"
120+
121+
rm -f private-key.pem
122+
123+
- name: Checkout repository
124+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
125+
if: ${{ steps.artifact-check.outputs.exists == 'true' }}
126+
with:
127+
repository: ${{ github.event.workflow_run.head_repository.full_name }}
128+
ref: ${{ github.event.workflow_run.head_branch }}
129+
path: 'pr-repo'
130+
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
131+
token: ${{ env.ACCESS_TOKEN }}
132+
133+
- name: Apply patch
134+
if: ${{ steps.artifact-check.outputs.exists == 'true' }}
135+
working-directory: 'pr-repo'
136+
run: git apply ${{ github.workspace }}/changes.diff
137+
138+
- name: Display changes to versioned files
139+
if: ${{ steps.artifact-check.outputs.exists == 'true' }}
140+
working-directory: 'pr-repo'
141+
run: git diff
142+
143+
- name: Configure git user name and email
144+
if: ${{ steps.artifact-check.outputs.exists == 'true' }}
145+
working-directory: 'pr-repo'
146+
env:
147+
GH_APP_ID: ${{ secrets.GH_PR_BUILT_FILES_APP_ID }}
148+
run: |
149+
git config user.name "wordpress-develop-pr-bot[bot]"
150+
git config user.email ${{ env.GH_APP_ID }}+wordpress-develop-pr-bot[bot]@users.noreply.github.com
151+
152+
- name: Stage changes
153+
if: ${{ steps.artifact-check.outputs.exists == 'true' }}
154+
working-directory: 'pr-repo'
155+
run: git add .
156+
157+
- name: Commit changes
158+
if: ${{ steps.artifact-check.outputs.exists == 'true' }}
159+
working-directory: 'pr-repo'
160+
run: |
161+
git commit -m "Automation: Updating built files with changes. [dependabot skip]"
162+
163+
- name: Push changes
164+
if: ${{ steps.artifact-check.outputs.exists == 'true' }}
165+
working-directory: 'pr-repo'
166+
run: git push

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
uses: ./.github/workflows/reusable-end-to-end-tests.yml
5959
permissions:
6060
contents: read
61-
if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }}
61+
if: ${{ github.repository == 'WordPress/wordpress-develop' || ( github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' ) }}
6262
strategy:
6363
fail-fast: false
6464
matrix:

0 commit comments

Comments
 (0)