Skip to content

Commit bfeb673

Browse files
Merge changes published in the Gutenberg plugin "release/20.8" branch
1 parent 01a314d commit bfeb673

File tree

170 files changed

+2057
-12958
lines changed

Some content is hidden

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

170 files changed

+2057
-12958
lines changed

.github/actionlint.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# This is the configuration file for actionlint, a static checker for GitHub Actions workflow files.
2+
# See https://github.com/rhysd/actionlint.
3+
4+
# Path-specific configurations.
5+
paths:
6+
.github/workflows/**/*.{yml,yaml}:
7+
ignore:
8+
# [SC2129](https://www.shellcheck.net/wiki/SC2129) is ignored because it is a stylistic issue.
9+
- 'shellcheck reported issue in this script: SC2129:.+'
10+
.github/workflows/end2end-test.yml:
11+
ignore:
12+
# This file gets created in the step prior.
13+
- 'file "build/index.js" does not exist.+'

.github/setup-node/action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ runs:
1010
using: 'composite'
1111
steps:
1212
- name: Use desired version of Node.js
13-
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
13+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
1414
with:
1515
node-version-file: '.nvmrc'
1616
node-version: ${{ inputs.node-version }}
@@ -20,12 +20,12 @@ runs:
2020
- name: Get Node.js and npm version
2121
id: node-version
2222
run: |
23-
echo "NODE_VERSION=$(node -v)" >> $GITHUB_OUTPUT
23+
echo "NODE_VERSION=$(node -v)" >> "$GITHUB_OUTPUT"
2424
shell: bash
2525

2626
- name: Cache node_modules
2727
id: cache-node_modules
28-
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
28+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
2929
with:
3030
path: '**/node_modules'
3131
key: node_modules-${{ runner.os }}-${{ runner.arch }}-${{ steps.node-version.outputs.NODE_VERSION }}-${{ hashFiles('package-lock.json') }}
@@ -36,7 +36,7 @@ runs:
3636
npm ci
3737
shell: bash
3838
- name: Upload npm logs as an artifact on failure
39-
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
39+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
4040
if: failure()
4141
with:
4242
name: npm-logs

.github/workflows/build-plugin-zip.yml

Lines changed: 84 additions & 41 deletions
Large diffs are not rendered by default.

.github/workflows/bundle-size.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,27 @@ concurrency:
3131
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
3232
cancel-in-progress: true
3333

34+
# Disable permissions for all available scopes by default.
35+
# Any needed permissions should be configured at the job level.
36+
permissions: {}
37+
3438
jobs:
3539
build:
3640
name: Check
3741
runs-on: ubuntu-latest
42+
permissions:
43+
contents: read
44+
pull-requests: write
3845

3946
steps:
4047
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4148
with:
4249
fetch-depth: 1
4350
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
51+
persist-credentials: false
4452

4553
- name: Use desired version of Node.js
46-
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
54+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
4755
with:
4856
node-version-file: '.nvmrc'
4957
check-latest: true

.github/workflows/check-backport-changelog.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,25 @@ on:
1818
- '!packages/block-serialization-default-parser/**'
1919
- '!packages/widgets/**'
2020
- '!packages/e2e-tests/**'
21+
22+
# Disable permissions for all available scopes by default.
23+
# Any needed permissions should be configured at the job level.
24+
permissions: {}
25+
2126
jobs:
2227
check:
2328
name: Check for a Core backport changelog entry
2429
runs-on: ubuntu-latest
30+
permissions:
31+
contents: read
2532
if: ${{ !contains(github.event.pull_request.labels.*.name, 'No Core Sync Required') && !contains(github.event.pull_request.labels.*.name, 'Backport from WordPress Core') }}
2633
steps:
2734
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2835
with:
2936
ref: ${{ github.event.pull_request.head.ref }}
3037
repository: ${{ github.event.pull_request.head.repo.full_name }}
38+
persist-credentials: false
39+
3140
- name: Check the changelog folder
3241
env:
3342
PR_NUMBER: ${{ github.event.number }}
@@ -46,7 +55,7 @@ jobs:
4655
exit 1
4756
fi
4857
49-
core_pr_number=$(basename "${changelog_file}" .md)
58+
core_pr_number="$(basename "${changelog_file}" .md)"
5059
core_pr_url="https://github\.com/WordPress/wordpress-develop/pull/${core_pr_number}"
5160
5261
# Confirm that the entry has the correct core backport PR URL.

.github/workflows/check-components-changelog.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,42 @@ on:
1414
- '!packages/components/src/**/*.native.js'
1515
- '!packages/components/src/**/*.native.scss'
1616
- '!packages/components/src/**/react-native-*'
17+
18+
# Disable permissions for all available scopes by default.
19+
# Any needed permissions should be configured at the job level.
20+
permissions: {}
21+
1722
jobs:
1823
check:
1924
name: Check CHANGELOG diff
2025
runs-on: ubuntu-latest
26+
permissions:
27+
contents: read
2128
steps:
2229
- name: 'Get PR commit count'
23-
run: echo "PR_COMMIT_COUNT=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}"
30+
env:
31+
PR_COUNT: ${{ github.event.pull_request.commits }}
32+
run: echo "PR_COMMIT_COUNT=$(( PR_COUNT + 1 ))" >> "${GITHUB_ENV}"
2433
- name: Checkout code
2534
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2635
with:
2736
ref: ${{ github.event.pull_request.head.ref }}
2837
repository: ${{ github.event.pull_request.head.repo.full_name }}
2938
fetch-depth: ${{ env.PR_COMMIT_COUNT }}
3039
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
40+
persist-credentials: false
3141
- name: 'Fetch relevant history from origin'
32-
run: git fetch origin ${{ github.event.pull_request.base.ref }}
42+
run: git fetch origin "$GITHUB_BASE_REF"
3343
- name: Check CHANGELOG status
3444
env:
3545
PR_NUMBER: ${{ github.event.number }}
46+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
3647
run: |
3748
changelog_path="packages/components/CHANGELOG.md"
3849
optional_check_notice="This isn't a required check, so if you think your changes are small enough that they don't warrant a CHANGELOG entry, please go ahead and merge without one."
3950
4051
# Fail if the PR doesn't touch the changelog
41-
if git diff --quiet ${{ github.event.pull_request.base.sha }} HEAD -- "$changelog_path"; then
52+
if git diff --quiet "$BASE_SHA" HEAD -- "$changelog_path"; then
4253
echo "Please add a CHANGELOG entry to $changelog_path"
4354
echo
4455
echo "${optional_check_notice}"

.github/workflows/cherry-pick-wp-release.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,17 @@ concurrency:
1616
group: ${{ github.workflow }}
1717
cancel-in-progress: false
1818

19+
# Disable permissions for all available scopes by default.
20+
# Any needed permissions should be configured at the job level.
21+
permissions: {}
22+
1923
jobs:
2024
cherry-pick:
2125
runs-on: ubuntu-latest
26+
permissions:
27+
contents: write
28+
issues: write
29+
pull-requests: read
2230
# When in the context of a PR, ensure the PR is merged.
2331
if: github.event.pull_request == null || github.event.pull_request.merged == true
2432
steps:
@@ -74,6 +82,7 @@ jobs:
7482
with:
7583
token: ${{ secrets.GUTENBERG_TOKEN }}
7684
fetch-depth: 0
85+
persist-credentials: false
7786

7887
- name: Set up Git
7988
if: env.cherry_pick == 'true'
@@ -85,20 +94,20 @@ jobs:
8594
id: cherry-pick
8695
if: env.cherry_pick == 'true'
8796
run: |
88-
TARGET_BRANCH="wp/${{ env.version }}"
89-
COMMIT_SHA="${{ env.commit_sha }}"
97+
TARGET_BRANCH="wp/${version}"
98+
COMMIT_SHA="${commit_sha}"
9099
echo "Target branch: $TARGET_BRANCH"
91100
echo "Commit SHA: $COMMIT_SHA"
92-
git checkout $TARGET_BRANCH
93-
git cherry-pick $COMMIT_SHA || echo "cherry-pick-failed" > result
101+
git checkout "$TARGET_BRANCH"
102+
git cherry-pick "$COMMIT_SHA" || echo "cherry-pick-failed" > result
94103
if [ -f result ] && grep -q "cherry-pick-failed" result; then
95-
echo "conflict=true" >> $GITHUB_ENV
104+
echo "conflict=true" >> "$GITHUB_ENV"
96105
git cherry-pick --abort
97106
else
98-
CHERRY_PICK_SHA=$(git rev-parse HEAD)
99-
echo "conflict=false" >> $GITHUB_ENV
100-
echo "cherry_pick_sha=$CHERRY_PICK_SHA" >> $GITHUB_ENV
101-
git push origin $TARGET_BRANCH
107+
CHERRY_PICK_SHA="$(git rev-parse HEAD)"
108+
echo "conflict=false" >> "$GITHUB_ENV"
109+
echo "cherry_pick_sha=$CHERRY_PICK_SHA" >> "$GITHUB_ENV"
110+
git push origin "$TARGET_BRANCH"
102111
fi
103112
104113
- name: Remove cherry-pick label

.github/workflows/create-block.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,16 @@ concurrency:
1212
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
1313
cancel-in-progress: true
1414

15+
# Disable permissions for all available scopes by default.
16+
# Any needed permissions should be configured at the job level.
17+
permissions: {}
18+
1519
jobs:
1620
checks:
1721
name: Checks w/Node.js ${{ matrix.node }} on ${{ matrix.os }}
1822
runs-on: ${{ matrix.os }}
23+
permissions:
24+
contents: read
1925
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
2026
strategy:
2127
fail-fast: false
@@ -27,6 +33,7 @@ jobs:
2733
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2834
with:
2935
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
36+
persist-credentials: false
3037

3138
- name: Setup Node.js and install dependencies
3239
uses: ./.github/setup-node

.github/workflows/end2end-test.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,16 @@ concurrency:
1515
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
1616
cancel-in-progress: true
1717

18+
# Disable permissions for all available scopes by default.
19+
# Any needed permissions should be configured at the job level.
20+
permissions: {}
21+
1822
jobs:
1923
e2e-playwright:
2024
name: Playwright - ${{ matrix.part }}
2125
runs-on: ubuntu-latest
26+
permissions:
27+
contents: read
2228
if: ${{ github.repository == 'WordPress/gutenberg' || github.event_name == 'pull_request' }}
2329
strategy:
2430
fail-fast: false
@@ -30,6 +36,7 @@ jobs:
3036
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3137
with:
3238
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
39+
persist-credentials: false
3340

3441
- name: Setup Node.js and install dependencies
3542
uses: ./.github/setup-node
@@ -48,8 +55,10 @@ jobs:
4855
- name: Run the tests
4956
env:
5057
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
58+
SHARD_PART: ${{ matrix.part }}
59+
SHARD_TOTAL: ${{ matrix.totalParts }}
5160
run: |
52-
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test:e2e -- --shard=${{ matrix.part }}/${{ matrix.totalParts }}
61+
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- npm run test:e2e -- --shard="${SHARD_PART}/${SHARD_TOTAL}"
5362
5463
- name: Archive debug artifacts (screenshots, traces)
5564
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
@@ -72,6 +81,7 @@ jobs:
7281
if: ${{ !cancelled() }}
7382
needs: [e2e-playwright]
7483
runs-on: ubuntu-latest
84+
permissions: {}
7585
outputs:
7686
has-flaky-test-report: ${{ !!steps.merge-flaky-tests-reports.outputs.artifact-id }}
7787
steps:
@@ -99,15 +109,20 @@ jobs:
99109
needs: [merge-artifacts]
100110
if: ${{ needs.merge-artifacts.outputs.has-flaky-test-report == 'true' }}
101111
runs-on: ubuntu-latest
112+
permissions:
113+
contents: read
114+
issues: write
115+
pull-requests: write
102116
steps:
103117
# Checkout defaults to using the branch which triggered the event, which
104118
# isn't necessarily `trunk` (e.g. in the case of a merge).
105119
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
106120
with:
107121
ref: trunk
108122
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
123+
persist-credentials: false
109124

110-
- uses: actions/download-artifact@v4.2.1
125+
- uses: actions/download-artifact@v4.3.0
111126
# Don't fail the job if there isn't any flaky tests report.
112127
continue-on-error: true
113128
with:

.github/workflows/enforce-pr-labels.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: Enforce labels on Pull Request
22
on:
33
pull_request_target:
44
types: [labeled, unlabeled, ready_for_review, review_requested]
5+
6+
# Disable permissions for all available scopes by default.
7+
# Any needed permissions should be configured at the job level.
8+
permissions: {}
9+
510
jobs:
611
type-related-labels:
712
runs-on: ubuntu-latest
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
name: 'Validate Gradle Wrapper'
22
on: [push, pull_request]
33

4+
# Disable permissions for all available scopes by default.
5+
# Any needed permissions should be configured at the job level.
6+
permissions: {}
7+
48
jobs:
59
validation:
610
name: 'Validation'
711
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
814
steps:
915
- name: Checkout repository
1016
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1117
with:
1218
show-progress: ${{ runner.debug == '1' && 'true' || 'false' }}
19+
persist-credentials: false
20+
1321
- name: Validate checksums
1422
uses: gradle/actions/wrapper-validation@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2

0 commit comments

Comments
 (0)