Skip to content

Commit 43a9674

Browse files
authored
Merge branch 'main' into copilot/fix-wp-core-check-update-issue
2 parents fec81ec + 8944997 commit 43a9674

File tree

7 files changed

+163
-2
lines changed

7 files changed

+163
-2
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Check Branch Alias
2+
3+
on:
4+
release:
5+
types: [released]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
check-branch-alias:
14+
uses: wp-cli/.github/.github/workflows/reusable-check-branch-alias.yml@main
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: "Copilot Setup Steps"
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
paths:
7+
- .github/workflows/copilot-setup-steps.yml
8+
pull_request:
9+
paths:
10+
- .github/workflows/copilot-setup-steps.yml
11+
12+
jobs:
13+
copilot-setup-steps:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v6
21+
22+
- name: Check existence of composer.json file
23+
id: check_composer_file
24+
uses: andstor/file-existence-action@v3
25+
with:
26+
files: "composer.json"
27+
28+
- name: Set up PHP environment
29+
if: steps.check_composer_file.outputs.files_exists == 'true'
30+
uses: shivammathur/setup-php@v2
31+
with:
32+
php-version: 'latest'
33+
ini-values: zend.assertions=1, error_reporting=-1, display_errors=On
34+
coverage: 'none'
35+
tools: composer,cs2pr
36+
env:
37+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Install Composer dependencies & cache dependencies
40+
if: steps.check_composer_file.outputs.files_exists == 'true'
41+
uses: ramsey/composer-install@v3
42+
env:
43+
COMPOSER_ROOT_VERSION: dev-${{ github.event.repository.default_branch }}
44+
with:
45+
# Bust the cache at least once a month - output format: YYYY-MM.
46+
custom-cache-suffix: $(date -u "+%Y-%m")

.github/workflows/issue-triage.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Issue and PR Triage
3+
4+
'on':
5+
issues:
6+
types: [opened]
7+
pull_request_target:
8+
types: [opened]
9+
workflow_dispatch:
10+
inputs:
11+
issue_number:
12+
description: 'Issue/PR number to triage (leave empty to process all)'
13+
required: false
14+
type: string
15+
16+
jobs:
17+
issue-triage:
18+
uses: wp-cli/.github/.github/workflows/reusable-issue-triage.yml@main
19+
with:
20+
issue_number: >-
21+
${{
22+
(github.event_name == 'workflow_dispatch' && inputs.issue_number) ||
23+
(github.event_name == 'pull_request_target' && github.event.pull_request.number) ||
24+
(github.event_name == 'issues' && github.event.issue.number) ||
25+
''
26+
}}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Manage Labels
3+
4+
'on':
5+
workflow_dispatch:
6+
push:
7+
branches:
8+
- main
9+
- master
10+
paths:
11+
- 'composer.json'
12+
13+
permissions:
14+
issues: write
15+
contents: read
16+
17+
jobs:
18+
manage-labels:
19+
uses: wp-cli/.github/.github/workflows/reusable-manage-labels.yml@main
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Welcome New Contributors
2+
3+
on:
4+
pull_request_target:
5+
types: [opened]
6+
branches:
7+
- main
8+
- master
9+
10+
jobs:
11+
welcome:
12+
uses: wp-cli/.github/.github/workflows/reusable-welcome-new-contributors.yml@main

features/core-update.feature

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ Feature: Update WordPress core
330330
When I run `wp post create --post_title='Test post' --porcelain`
331331
Then STDOUT should be a number
332332

333-
@require-php-7.2
333+
@require-php-7.4
334334
Scenario Outline: Use `--version=(nightly|trunk)` to update to the latest nightly version
335335
Given a WP install
336336

@@ -350,7 +350,7 @@ Feature: Update WordPress core
350350
| trunk |
351351
| nightly |
352352

353-
@require-php-7.2
353+
@require-php-7.4
354354
Scenario: Installing latest nightly build should skip cache
355355
Given a WP install
356356

@@ -384,3 +384,38 @@ Feature: Update WordPress core
384384
"""
385385
Success:
386386
"""
387+
388+
Scenario: No HTML output from async translation updates during core update
389+
Given a WP install
390+
And an empty cache
391+
392+
# Using `try` in case there are checksum warnings.
393+
When I try `wp core download --version=6.5 --locale=de_DE --force`
394+
Then STDOUT should contain:
395+
"""
396+
Success: WordPress downloaded.
397+
"""
398+
399+
When I run `wp core version --extra`
400+
Then STDOUT should contain:
401+
"""
402+
Package language: de_DE
403+
"""
404+
405+
When I run `wp core update --version=latest --force`
406+
Then STDOUT should not contain:
407+
"""
408+
<p>
409+
"""
410+
And STDOUT should not contain:
411+
"""
412+
<div
413+
"""
414+
And STDOUT should not contain:
415+
"""
416+
<script
417+
"""
418+
And STDOUT should not contain:
419+
"""
420+
</div>
421+
"""

src/Core_Command.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,6 +1228,15 @@ public function update( $args, $assoc_args ) {
12281228

12291229
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
12301230

1231+
// Prevent async translation updates which output HTML.
1232+
add_action(
1233+
'upgrader_process_complete',
1234+
static function () {
1235+
remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
1236+
},
1237+
1
1238+
);
1239+
12311240
if ( $update->version ) {
12321241
WP_CLI::log( "Updating to version {$update->version} ({$update->locale})..." );
12331242
} else {

0 commit comments

Comments
 (0)