Skip to content

Commit 0aa3e06

Browse files
committed
Merge branch 'trunk' into fix-63029/align-revision-buttons
2 parents 17896f4 + 1563bf7 commit 0aa3e06

File tree

267 files changed

+8790
-2660
lines changed

Some content is hidden

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

267 files changed

+8790
-2660
lines changed
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Checks for uncommitted changes to built files and pushes changes back.
2+
name: Check built files
3+
4+
on:
5+
# Because all commits happen through SVN and should always be manually reviewed by a committer, this workflow only
6+
# runs for pull requests.
7+
#
8+
# Other workflows that run on push will detect changes to versioned files and fail.
9+
pull_request_target:
10+
branches:
11+
- trunk
12+
- '6.[8-9]'
13+
- '[7-9].[0-9]'
14+
paths:
15+
# Any change to a CSS, JavaScript, JSON, or SASS file should run checks.
16+
- '**.css'
17+
- '**.js'
18+
- '**.json'
19+
- '**.sass'
20+
# These files configure npm and the task runner. Changes could affect the outcome.
21+
- 'package*.json'
22+
- 'Gruntfile.js'
23+
- 'webpack.config.js'
24+
- 'tools/webpack/**'
25+
# These files configure Composer. Changes could affect the outcome.
26+
- 'composer.*'
27+
# Confirm any changes to relevant workflow files.
28+
- '.github/workflows/check-built-files.yml'
29+
30+
# Cancels all previous workflow runs for pull requests that have not completed.
31+
concurrency:
32+
# The concurrency group contains the workflow name and the branch name for pull requests
33+
# or the commit hash for any other events.
34+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.sha }}
35+
cancel-in-progress: true
36+
37+
# Disable permissions for all available scopes by default.
38+
# Any needed permissions should be configured at the job level.
39+
permissions: {}
40+
41+
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 }}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ on:
3333
- 'tests/e2e/**'
3434
# Confirm any changes to relevant workflow files.
3535
- '.github/workflows/end-to-end-tests.yml'
36-
- '.github/workflows/reusable-end-to-end-tests-*.yml'
36+
- '.github/workflows/reusable-end-to-end-tests*.yml'
3737
workflow_dispatch:
3838

3939
# Cancels all previous workflow runs for pull requests that have not completed.

.github/workflows/reusable-build-package.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
persist-credentials: false
3636

3737
- name: Set up Node.js
38-
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
38+
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
3939
with:
4040
node-version-file: '.nvmrc'
4141
cache: npm
@@ -53,7 +53,7 @@ jobs:
5353
run: zip -q -r develop.zip wordpress/.
5454

5555
- name: Upload ZIP as a GitHub Actions artifact
56-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
56+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
5757
with:
5858
name: wordpress-develop
5959
path: develop.zip
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
name: Lint GitHub Actions workflows
2+
on:
3+
workflow_call:
4+
secrets:
5+
GH_APP_ID:
6+
description: 'A GitHub App ID.'
7+
required: true
8+
GH_APP_PRIVATE_KEY:
9+
description: 'A GitHub App private key.'
10+
required: true
11+
12+
permissions: {}
13+
14+
jobs:
15+
# Checks a PR for uncommitted changes to built files.
16+
#
17+
# This job uses a GitHub App instead of $GITHUB_TOKEN because Dependabot pull requests are only granted
18+
# read-only access.
19+
#
20+
# Performs the following steps:
21+
# - Generates a token for authenticating with the GitHub App.
22+
# - Checks out the repository.
23+
# - Sets up Node.js.
24+
# - Configures caching for Composer.
25+
# - Installs Composer dependencies.
26+
# - Logs general debug information about the runner.
27+
# - Installs npm dependencies.
28+
# - Builds CSS file using SASS.
29+
# - Builds Emoji files.
30+
# - Builds bundled Root Certificate files.
31+
# - Builds WordPress.
32+
# - Checks for changes to versioned files.
33+
# - Displays the result of git diff for debugging purposes.
34+
# - Configures the Git author.
35+
# - Stages changes.
36+
# - Commits changes.
37+
# - Pushes changes.
38+
update-built-files:
39+
name: Check and update built files
40+
runs-on: ubuntu-24.04
41+
# This prevents an unnecessary second run after changes are committed back because Dependabot always rebases
42+
# updates and force pushes.
43+
if: ${{ github.actor != 'dependabot[bot]' || github.event.commits < 2 }}
44+
timeout-minutes: 10
45+
permissions:
46+
contents: write
47+
steps:
48+
- name: Generate Installation Token
49+
id: generate_token
50+
env:
51+
GH_APP_ID: ${{ secrets.GH_APP_ID }}
52+
GH_APP_PRIVATE_KEY: ${{ secrets.GH_APP_PRIVATE_KEY }}
53+
run: |
54+
echo "$GH_APP_PRIVATE_KEY" > private-key.pem
55+
56+
# Generate JWT
57+
JWT=$(python3 - <<EOF
58+
import jwt, time
59+
private_key = open("private-key.pem", "r").read()
60+
payload = {
61+
"iat": int(time.time()),
62+
"exp": int(time.time()) + 600, # 10-minute expiration
63+
"iss": $GH_APP_ID
64+
}
65+
print(jwt.encode(payload, private_key, algorithm="RS256"))
66+
EOF
67+
)
68+
69+
# Get Installation ID
70+
INSTALLATION_ID=$(curl -s -X GET -H "Authorization: Bearer $JWT" \
71+
-H "Accept: application/vnd.github.v3+json" \
72+
https://api.github.com/app/installations | jq -r '.[0].id')
73+
74+
# Request Installation Access Token
75+
ACCESS_TOKEN=$(curl -s -X POST -H "Authorization: Bearer $JWT" \
76+
-H "Accept: application/vnd.github.v3+json" \
77+
"https://api.github.com/app/installations/$INSTALLATION_ID/access_tokens" | jq -r '.token')
78+
79+
echo "ACCESS_TOKEN=$ACCESS_TOKEN" >> "$GITHUB_ENV"
80+
81+
rm -f private-key.pem
82+
83+
- name: Checkout repository
84+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
85+
with:
86+
repository: ${{ github.event.pull_request.head.repo.full_name }}
87+
ref: ${{ github.event.pull_request.head.ref }}
88+
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
89+
token: ${{ env.ACCESS_TOKEN }}
90+
91+
- name: Set up Node.js
92+
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
93+
with:
94+
node-version-file: '.nvmrc'
95+
cache: npm
96+
97+
# This date is used to ensure that the PHPCS cache is cleared at least once every week.
98+
# http://man7.org/linux/man-pages/man1/date.1.html
99+
- name: "Get last Monday's date"
100+
id: get-date
101+
run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> "$GITHUB_OUTPUT"
102+
103+
# Since Composer dependencies are installed using `composer update` and no lock file is in version control,
104+
# passing a custom cache suffix ensures that the cache is flushed at least once per week.
105+
- name: Install Composer dependencies
106+
uses: ramsey/composer-install@a2636af0004d1c0499ffca16ac0b4cc94df70565 # v3.1.0
107+
with:
108+
custom-cache-suffix: ${{ steps.get-date.outputs.date }}
109+
110+
- name: Log debug information
111+
run: |
112+
npm --version
113+
node --version
114+
curl --version
115+
git --version
116+
117+
- name: Install npm Dependencies
118+
run: npm ci
119+
120+
- name: Run SASS precommit tasks
121+
run: npm run grunt precommit:css
122+
123+
- name: Run Emoji precommit task
124+
run: npm run grunt precommit:emoji
125+
env:
126+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
127+
128+
- name: Run certificate tasks
129+
run: npm run grunt copy:certificates
130+
131+
- name: Build WordPress
132+
run: npm run build:dev
133+
134+
- name: Check for changes to versioned files
135+
id: built-file-check
136+
run: |
137+
if git diff --quiet; then
138+
echo "uncommitted_changes=false" >> "$GITHUB_OUTPUT"
139+
else
140+
echo "uncommitted_changes=true" >> "$GITHUB_OUTPUT"
141+
fi
142+
143+
- name: Display changes to versioned files
144+
if: ${{ steps.built-file-check.outputs.uncommitted_changes == 'true' }}
145+
run: git diff
146+
147+
- name: Configure git user name and email
148+
if: ${{ steps.built-file-check.outputs.uncommitted_changes == 'true' }}
149+
run: |
150+
git config user.name "wordpress-develop-pr-bot[bot]"
151+
git config user.email ${{ secrets.GH_APP_ID }}+wordpress-develop-pr-bot[bot]@users.noreply.github.com
152+
153+
- name: Stage changes
154+
if: ${{ steps.built-file-check.outputs.uncommitted_changes == 'true' }}
155+
run: git add .
156+
157+
- name: Commit changes
158+
if: ${{ steps.built-file-check.outputs.uncommitted_changes == 'true' }}
159+
run: |
160+
git commit -m "Automation: Updating built files with changes. [dependabot skip]"
161+
162+
- name: Push changes
163+
if: ${{ steps.built-file-check.outputs.uncommitted_changes == 'true' }}
164+
run: git push

.github/workflows/reusable-coding-standards-javascript.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
persist-credentials: false
4141

4242
- name: Set up Node.js
43-
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
43+
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
4444
with:
4545
node-version-file: '.nvmrc'
4646
cache: npm

.github/workflows/reusable-coding-standards-php.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> "$GITHUB_OUTPUT"
6666

6767
- name: Cache PHPCS scan cache
68-
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
68+
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
6969
with:
7070
path: |
7171
.cache/phpcs-src.json
@@ -75,7 +75,7 @@ jobs:
7575
# Since Composer dependencies are installed using `composer update` and no lock file is in version control,
7676
# passing a custom cache suffix ensures that the cache is flushed at least once per week.
7777
- name: Install Composer dependencies
78-
uses: ramsey/composer-install@57532f8be5bda426838819c5ee9afb8af389d51a # v3.0.0
78+
uses: ramsey/composer-install@a2636af0004d1c0499ffca16ac0b4cc94df70565 # v3.1.0
7979
with:
8080
custom-cache-suffix: ${{ steps.get-date.outputs.date }}
8181

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

+8-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ on:
2828
description: 'A specific version of Gutenberg to install.'
2929
required: false
3030
type: 'string'
31+
install-playwright:
32+
description: 'Whether to install Playwright browsers.'
33+
required: false
34+
type: 'boolean'
35+
default: true
3136

3237
env:
3338
LOCAL_DIR: build
@@ -77,7 +82,7 @@ jobs:
7782
persist-credentials: false
7883

7984
- name: Set up Node.js
80-
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
85+
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
8186
with:
8287
node-version-file: '.nvmrc'
8388
cache: npm
@@ -94,6 +99,7 @@ jobs:
9499
run: npm ci
95100

96101
- name: Install Playwright browsers
102+
if: ${{ inputs.install-playwright }}
97103
run: npx playwright install --with-deps
98104

99105
- name: Build WordPress
@@ -139,7 +145,7 @@ jobs:
139145
run: npm run test:e2e
140146

141147
- name: Archive debug artifacts (screenshots, HTML snapshots)
142-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
148+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
143149
if: always()
144150
with:
145151
name: failures-artifacts${{ inputs.LOCAL_SCRIPT_DEBUG && '-SCRIPT_DEBUG' || '' }}-${{ github.run_id }}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
persist-credentials: false
4242

4343
- name: Set up Node.js
44-
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
44+
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
4545
with:
4646
node-version-file: '.nvmrc'
4747
cache: npm

.github/workflows/reusable-performance-report-v2.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ jobs:
6262
persist-credentials: false
6363

6464
- name: Set up Node.js
65-
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
65+
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
6666
with:
6767
node-version-file: '.nvmrc'
6868
cache: npm
6969

7070
- name: Download artifacts
71-
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
71+
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
7272
with:
7373
pattern: performance-${{ inputs.multisite && 'multisite' || 'single' }}-${{ inputs.memcached && 'memcached' || 'default' }}-*
7474
path: artifacts

.github/workflows/reusable-performance-test-v2.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ jobs:
122122
persist-credentials: false
123123

124124
- name: Set up Node.js
125-
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
125+
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
126126
with:
127127
node-version-file: '.nvmrc'
128128
cache: npm
@@ -258,7 +258,7 @@ jobs:
258258
TEST_RESULTS_PREFIX: ${{ inputs.subject != 'current' && inputs.subject || '' }}
259259

260260
- name: Archive artifacts
261-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
261+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
262262
if: always()
263263
with:
264264
name: performance-${{ inputs.multisite && 'multisite' || 'single' }}-${{ inputs.memcached && 'memcached' || 'default' }}-${{ inputs.subject }}

.github/workflows/reusable-performance.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ jobs:
139139
run: echo "TARGET_SHA=$(git rev-parse HEAD^1)" >> "$GITHUB_ENV"
140140

141141
- name: Set up Node.js
142-
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
142+
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
143143
with:
144144
node-version-file: '.nvmrc'
145145
cache: npm
@@ -312,7 +312,7 @@ jobs:
312312
run: npm run test:performance
313313

314314
- name: Archive artifacts
315-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
315+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
316316
if: always()
317317
with:
318318
name: performance-artifacts${{ inputs.multisite && '-multisite' || '' }}${{ inputs.memcached && '-memcached' || '' }}-${{ github.run_id }}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,15 @@ jobs:
6363
run: echo "date=$(/bin/date -u --date='last Mon' "+%F")" >> "$GITHUB_OUTPUT"
6464

6565
- name: Cache PHP compatibility scan cache
66-
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
66+
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
6767
with:
6868
path: .cache/phpcompat.json
6969
key: ${{ runner.os }}-date-${{ steps.get-date.outputs.date }}-php-${{ inputs.php-version }}-phpcompat-cache-${{ hashFiles('**/composer.json', 'phpcompat.xml.dist') }}
7070

7171
# Since Composer dependencies are installed using `composer update` and no lock file is in version control,
7272
# passing a custom cache suffix ensures that the cache is flushed at least once per week.
7373
- name: Install Composer dependencies
74-
uses: ramsey/composer-install@57532f8be5bda426838819c5ee9afb8af389d51a # v3.0.0
74+
uses: ramsey/composer-install@a2636af0004d1c0499ffca16ac0b4cc94df70565 # v3.1.0
7575
with:
7676
custom-cache-suffix: ${{ steps.get-date.outputs.date }}
7777

0 commit comments

Comments
 (0)