Skip to content

Commit f7b37b8

Browse files
authored
Merge pull request #314 from wpengine/chore-fix-composer-package-file
chore: Rename composer package and fix workflow for main
2 parents f9d3e89 + bb3bb2e commit f7b37b8

File tree

10 files changed

+36
-24
lines changed

10 files changed

+36
-24
lines changed

.github/scripts/get_plugin_slug.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ HEAD_SHA="$2"
88
git fetch --prune --unshallow 2>/dev/null || git fetch --prune
99

1010
# Get changed files in plugins subdirectories
11-
if [ "$BASE_SHA" = "release" ]; then
11+
if [ "$BASE_SHA" = "release" ] || [ "$BASE_SHA" = "main" ]; then
1212
CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD | grep '^plugins/[^/]\+/' || true)
1313
else
1414
CHANGED_FILES=$(git diff --name-only "$BASE_SHA" "$HEAD_SHA" | grep '^plugins/[^/]\+/' || true)

.github/scripts/update_composer_package.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ usage() {
2323
echo " With custom package name and description:"
2424
echo " $0 '0.0.5' 'https://example.com/plugin.zip' 'wpengine/my-plugin' 'My custom plugin description'"
2525
echo ""
26-
echo "Note: Updates plugins/package.json file"
26+
echo "Note: Updates plugins/composer-packages.json file"
2727
exit 1
2828
}
2929

@@ -38,7 +38,7 @@ VERSION="$1"
3838
RELEASE_URL="$2"
3939
PACKAGE_NAME="$3"
4040
DESCRIPTION="$4"
41-
COMPOSER_FILE="plugins/package.json"
41+
COMPOSER_FILE="plugins/composer-packages.json"
4242

4343
# Function to extract package name from release URL
4444
extract_package_name() {

.github/workflows/code-quality.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ on:
1212
branches:
1313
- main
1414
paths:
15-
- 'plugins/**.php'
15+
- 'plugins/*/**.php'
1616
pull_request:
1717
paths:
18-
- 'plugins/**.php'
18+
- 'plugins/*/**.php'
1919

2020
jobs:
2121
detect-plugins:
@@ -31,7 +31,11 @@ jobs:
3131
- name: Get changed plugin directory
3232
id: plugin
3333
run: |
34-
bash .github/scripts/get_plugin_slug.sh ${{ github.event.pull_request.base.sha }} ${{ github.sha }}
34+
if [ "${{ github.event_name }}" = "push" ]; then
35+
bash .github/scripts/get_plugin_slug.sh main
36+
else
37+
bash .github/scripts/get_plugin_slug.sh ${{ github.event.pull_request.base.sha }} ${{ github.sha }}
38+
fi
3539
3640
- name: Detect changed plugins with quality config
3741
id: detect

.github/workflows/codeception.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ on:
1212
branches:
1313
- main
1414
paths:
15-
- 'plugins/**.php'
15+
- 'plugins/*/**.php'
1616
pull_request:
1717
paths:
18-
- 'plugins/**.php'
18+
- 'plugins/*/**.php'
1919

2020
# Cancel previous workflow run groups that have not completed.
2121
concurrency:
@@ -38,7 +38,11 @@ jobs:
3838
- name: Get changed plugin directory
3939
id: plugin
4040
run: |
41-
bash .github/scripts/get_plugin_slug.sh ${{ github.event.pull_request.base.sha }} ${{ github.sha }}
41+
if [ "${{ github.event_name }}" = "push" ]; then
42+
bash .github/scripts/get_plugin_slug.sh main
43+
else
44+
bash .github/scripts/get_plugin_slug.sh ${{ github.event.pull_request.base.sha }} ${{ github.sha }}
45+
fi
4246
4347
- name: Detect changed plugins with quality config
4448
id: detect

.github/workflows/create-release-branch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
branches:
99
- main
1010
paths:
11-
- "plugins/**"
11+
- "plugins/*/**"
1212

1313
permissions:
1414
contents: write # Allow actions to read and write repository contents

.github/workflows/e2e-test.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,18 @@ on:
1313
branches:
1414
- main
1515
paths:
16-
- 'plugins/**.php'
17-
- 'plugins/**.js'
18-
- 'plugins/**.css'
19-
- 'plugins/**.json'
16+
- 'plugins/*/**.php'
17+
- 'plugins/*/**.js'
18+
- 'plugins/*/**.css'
19+
- 'plugins/*/**.json'
2020
pull_request:
2121
branches:
2222
- main
2323
paths:
24-
- "plugins/**"
24+
- 'plugins/*/**.php'
25+
- 'plugins/*/**.js'
26+
- 'plugins/*/**.css'
27+
- 'plugins/*/**.json'
2528

2629
jobs:
2730
detect-plugin:
@@ -37,7 +40,11 @@ jobs:
3740
- name: Get changed plugin directory
3841
id: plugin
3942
run: |
40-
bash .github/scripts/get_plugin_slug.sh ${{ github.event.pull_request.base.sha }} ${{ github.sha }}
43+
if [ "${{ github.event_name }}" = "push" ]; then
44+
bash .github/scripts/get_plugin_slug.sh main
45+
else
46+
bash .github/scripts/get_plugin_slug.sh ${{ github.event.pull_request.base.sha }} ${{ github.sha }}
47+
fi
4148
4249
- name: Detect changed plugin with E2E config
4350
id: detect

.github/workflows/plugin-artifact-for-pr.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: Plugin Artifact for PR
33
on:
44
pull_request:
55
paths:
6-
- 'plugins/**.php'
7-
- 'plugins/**.js'
8-
- 'plugins/**.css'
9-
- 'plugins/**.json'
6+
- 'plugins/*/**.php'
7+
- 'plugins/*/**.js'
8+
- 'plugins/*/**.css'
9+
- 'plugins/*/**.json'
1010

1111
jobs:
1212
create-plugin-artifact:

.github/workflows/pre-release-tag.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
branches:
1111
- main
1212
paths:
13-
- "plugins/**"
13+
- "plugins/*/*"
1414

1515
permissions:
1616
contents: write

plugins/hwp-previews/tests/bootstrap.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,14 @@
77
* @link https://github.com/wpengine/hwptoolkit/blob/main/plugins/hwp-previews/TESTING.md
88
*/
99

10-
// Ensure proper autoloading
1110
if (file_exists(__DIR__ . '/../../vendor/autoload.php')) {
1211
require_once __DIR__ . '/../../vendor/autoload.php';
1312
}
1413

15-
// Load the main plugin file to ensure all classes are available
1614
if (file_exists(__DIR__ . '/../../hwp-previews.php')) {
1715
require_once __DIR__ . '/../../hwp-previews.php';
1816
}
1917

20-
// Load access functions if they exist
2118
if (file_exists(__DIR__ . '/../../access-functions.php')) {
2219
require_once __DIR__ . '/../../access-functions.php';
2320
}

0 commit comments

Comments
 (0)