Skip to content

Commit 58a81da

Browse files
authored
Merge pull request #1145 from newfold-labs/release/2.15.2
Automated patch release: 2.15.2
2 parents 5b2282d + 4e33f1a commit 58a81da

19 files changed

+1009
-792
lines changed

.github/workflows/cypress-matrix.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ name: Cypress Test Matrix
22

33
on:
44
pull_request:
5-
types: [ opened, edited, reopened, ready_for_review, synchronize ]
5+
types: [ opened, synchronize, reopened, ready_for_review ]
66
branches:
77
- 'main'
88
workflow_dispatch:
99

1010
concurrency:
11-
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
11+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
1212
cancel-in-progress: true
1313

1414
jobs:
@@ -35,10 +35,10 @@ jobs:
3535
steps:
3636

3737
- name: Checkout
38-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
38+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3939

4040
- name: Setup PHP
41-
uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1
41+
uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1
4242
with:
4343
php-version: '8.1'
4444
coverage: none
@@ -55,7 +55,7 @@ jobs:
5555
echo "PACKAGE=${REPO##*/}" >> $GITHUB_OUTPUT
5656
5757
- name: Use Node.js 20.x
58-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
58+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
5959
with:
6060
node-version: 20.x
6161
cache: 'npm'
@@ -65,7 +65,7 @@ jobs:
6565
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
6666

6767
- name: Cache Composer vendor directory
68-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
68+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
6969
with:
7070
path: ${{ steps.composer-cache.outputs.dir }}
7171
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -83,10 +83,7 @@ jobs:
8383
run: composer validate
8484

8585
- name: Install PHP Dependencies
86-
run: composer install --no-progress --no-dev --optimize-autoloader --prefer-dist
87-
88-
- name: Setup Registry
89-
run: printf "\n//npm.pkg.github.com/:_authToken=${{ secrets.NEWFOLD_ACCESS_TOKEN }}" >> .npmrc
86+
run: composer install --no-progress --no-dev --optimize-autoloader --prefer-source
9087

9188
- name: NPM Install
9289
run: npm install --legacy-peer-deps
@@ -110,7 +107,7 @@ jobs:
110107
echo '{"wpVersion": "${{ matrix.wpVersion }}","phpVersion": "${{ matrix.phpVersion }}"}' > cypress.env.json
111108
112109
- name: Install WordPress
113-
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
110+
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
114111
with:
115112
timeout_minutes: 4
116113
max_attempts: 3
@@ -126,7 +123,7 @@ jobs:
126123

127124
- name: Store screenshots of test failures
128125
if: ${{ failure() }}
129-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
126+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
130127
with:
131128
name: screenshots
132129
path: ./tests/cypress/screenshots

.github/workflows/cypress-tests-beta.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818

1919
steps:
2020
- name: Checkout
21-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2222

2323
- name: Setup PHP
24-
uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1
24+
uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1
2525
with:
2626
php-version: '8.1'
2727
coverage: none
@@ -37,7 +37,7 @@ jobs:
3737
echo "DIST=${PWD}/dist" >> $GITHUB_OUTPUT
3838
echo "PACKAGE=${REPO##*/}" >> $GITHUB_OUTPUT
3939
- name: Use Node.js 20.x
40-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
40+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
4141
with:
4242
node-version: 20.x
4343
cache: 'npm'
@@ -47,7 +47,7 @@ jobs:
4747
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
4848

4949
- name: Cache Composer vendor directory
50-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
50+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
5151
with:
5252
path: ${{ steps.composer-cache.outputs.dir }}
5353
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -63,10 +63,7 @@ jobs:
6363
run: composer validate
6464

6565
- name: Install PHP Dependencies
66-
run: composer install --no-progress --no-dev --optimize-autoloader --prefer-dist
67-
68-
- name: Setup Registry
69-
run: printf "\n//npm.pkg.github.com/:_authToken=${{ secrets.NEWFOLD_ACCESS_TOKEN }}" >> .npmrc
66+
run: composer install --no-progress --no-dev --optimize-autoloader --prefer-source
7067

7168
- name: NPM Install
7269
run: npm install --legacy-peer-deps
@@ -104,7 +101,7 @@ jobs:
104101

105102
- name: Store screenshots of test failures
106103
if: failure()
107-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
104+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
108105
with:
109106
name: screenshots
110107
path: ./tests/cypress/screenshots

.github/workflows/cypress-tests.yml

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
push:
55
branches:
66
- main
7-
- master
8-
- trunk
97
- develop
108
- release/*
119
- feature/*
@@ -14,11 +12,11 @@ on:
1412
- fix/*
1513
- try/*
1614
pull_request:
17-
types: [opened, edited, reopened, ready_for_review]
15+
types: [opened, synchronize, reopened, ready_for_review]
1816
workflow_dispatch:
1917

2018
concurrency:
21-
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
19+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
2220
cancel-in-progress: true
2321

2422
jobs:
@@ -28,10 +26,10 @@ jobs:
2826
steps:
2927

3028
- name: Checkout
31-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
29+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3230

3331
- name: Setup PHP
34-
uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1
32+
uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1
3533
with:
3634
php-version: '8.1'
3735
coverage: none
@@ -48,7 +46,7 @@ jobs:
4846
echo "PACKAGE=${REPO##*/}" >> $GITHUB_OUTPUT
4947
5048
- name: Use Node.js 20.x
51-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
49+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
5250
with:
5351
node-version: 20.x
5452

@@ -57,7 +55,7 @@ jobs:
5755
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT
5856

5957
- name: Cache node modules
60-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
58+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
6159
with:
6260
path: ${{ steps.npm-cache.outputs.dir }}
6361
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@@ -69,7 +67,7 @@ jobs:
6967
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
7068

7169
- name: Cache Composer vendor directory
72-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
70+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
7371
with:
7472
path: ${{ steps.composer-cache.outputs.dir }}
7573
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -87,10 +85,7 @@ jobs:
8785
run: composer validate
8886

8987
- name: Install PHP Dependencies
90-
run: composer install --no-progress --no-dev --optimize-autoloader --prefer-dist
91-
92-
- name: Setup Registry
93-
run: printf "\n//npm.pkg.github.com/:_authToken=${{ secrets.NEWFOLD_ACCESS_TOKEN }}" >> .npmrc
88+
run: composer install --no-progress --no-dev --optimize-autoloader --prefer-source
9489

9590
- name: NPM Install
9691
run: npm install --legacy-peer-deps
@@ -109,7 +104,7 @@ jobs:
109104
run: echo '{"config":{"WP_DEBUG_DISPLAY":false},"plugins":["${{ steps.workflow.outputs.DIST }}/${{ steps.workflow.outputs.PACKAGE }}"]}' > .wp-env.override.json
110105

111106
- name: Install WordPress
112-
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
107+
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
113108
with:
114109
timeout_minutes: 4
115110
max_attempts: 3
@@ -125,7 +120,7 @@ jobs:
125120

126121
- name: Store screenshots of test failures
127122
if: ${{ failure() }}
128-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
123+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
129124
with:
130125
name: screenshots
131126
path: ./tests/cypress/screenshots

.github/workflows/upload-artifact-on-push.yml

Lines changed: 54 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ on:
1111
- update/*
1212
- fix/*
1313
- try/*
14+
pull_request:
15+
types: [ opened, synchronize, reopened, ready_for_review ]
1416
workflow_dispatch:
17+
1518
concurrency:
16-
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
19+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
1720
cancel-in-progress: true
1821

1922
jobs:
@@ -24,10 +27,10 @@ jobs:
2427
steps:
2528

2629
- name: Checkout
27-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
30+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2831

2932
- name: Setup PHP
30-
uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1
33+
uses: shivammathur/setup-php@0f7f1d08e3e32076e51cae65eb0b0c871405b16e # v2.34.1
3134
with:
3235
php-version: '8.1'
3336
coverage: none
@@ -44,7 +47,7 @@ jobs:
4447
echo "PACKAGE=${REPO##*/}" >> $GITHUB_OUTPUT
4548
4649
- name: Use Node.js 20.x
47-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
50+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
4851
with:
4952
node-version: 20.x
5053

@@ -53,7 +56,7 @@ jobs:
5356
run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT
5457

5558
- name: Cache node modules
56-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
59+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
5760
with:
5861
path: ${{ steps.npm-cache.outputs.dir }}
5962
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
@@ -65,7 +68,7 @@ jobs:
6568
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
6669

6770
- name: Cache Composer vendor directory
68-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
71+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
6972
with:
7073
path: ${{ steps.composer-cache.outputs.dir }}
7174
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
@@ -86,9 +89,6 @@ jobs:
8689
- name: Install PHP Dependencies
8790
run: composer install --no-progress --no-dev --optimize-autoloader --prefer-dist
8891

89-
- name: Setup Registry
90-
run: printf "\n//npm.pkg.github.com/:_authToken=${{ secrets.NEWFOLD_ACCESS_TOKEN }}" >> .npmrc
91-
9292
- name: NPM Install
9393
run: npm install --legacy-peer-deps
9494

@@ -102,7 +102,51 @@ jobs:
102102
working-directory: ${{ steps.workflow.outputs.DIST }}
103103
run: find .
104104

105-
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
105+
- name: Upload Artifact
106+
id: artifact
107+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
106108
with:
107109
name: ${{ steps.workflow.outputs.PACKAGE }}
108110
path: ${{ steps.workflow.outputs.DIST }}
111+
include-hidden-files: true
112+
113+
- name: Comment on PR with download link
114+
if: github.event_name == 'pull_request'
115+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
116+
with:
117+
github-token: ${{ secrets.GITHUB_TOKEN }}
118+
script: |
119+
const prNumber = context.payload.pull_request.number;
120+
const commentMeta = '<!-- plugin-artifact-download -->';
121+
const artifactUrl = '${{ steps.artifact.outputs.artifact-url }}';
122+
const commentBody = `
123+
${commentMeta}
124+
## Latest Plugin Build
125+
⬇️ [_Download build artifact:_ \`${artifactUrl}\`](${artifactUrl})
126+
🗂️ _Built from:_ \`${context.payload.pull_request.head.ref}\`
127+
📦 _Commit:_ \`${context.payload.pull_request.head.sha.slice(0, 7)}\`
128+
📅 _Date:_ \`${new Date().toISOString()}\`
129+
🚀 Please download, test, and report any issues before merging. 🎉 This build includes the latest changes from this PR and was automatically generated by the GitHub Actions workflow. Any future commits will update this build.
130+
⏳ _Note: Artifacts expire after ~90 days_
131+
`;
132+
const { data: comments } = await github.rest.issues.listComments({
133+
issue_number: prNumber,
134+
owner: context.repo.owner,
135+
repo: context.repo.repo,
136+
});
137+
const existingComment = comments.find(c => c.body.includes(commentMeta));
138+
if (existingComment) {
139+
await github.rest.issues.updateComment({
140+
comment_id: existingComment.id,
141+
owner: context.repo.owner,
142+
repo: context.repo.repo,
143+
body: commentBody,
144+
});
145+
} else {
146+
await github.rest.issues.createComment({
147+
issue_number: prNumber,
148+
owner: context.repo.owner,
149+
repo: context.repo.repo,
150+
body: commentBody,
151+
});
152+
}

0 commit comments

Comments
 (0)